cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
339
Views
0
Helpful
1
Replies

What's the difference between WLAN adapter address and host address?

ValdezV1
Level 1
Level 1

When I connect to a WLAN, I can get a result as following through ipconfig:

Ethernet adapter Ethernet:
IPv4 address . . . . . . . . . . . . : 172.19.83.237
Subnet Mask . . . . . . . . . . . . : 255.255.255.0

Wireless LAN adapter WLAN:
IPv4 address . . . . . . . . . . . . : 10.30.16.37
Subnet Mask . . . . . . . . . . . . : 255.255.0.0
But when I use a python script to check the host IP of my computer, the result is different. Codes:

import socket

host = socket.gethostname()
print("host: " + str(host))
host_ip = socket.gethostbyname(host)
print("host ip: " + str(host_ip))

Any help will be appreciated.   QuestDiagnostics

 

 

1 Reply 1

Hi

 This means that this PC have two interfaces: wireless and wired.

And both have IP address.

"

Overview:

  • Given a host name the gethostbyname() function returns the IP address of the host.

 

  • Unlike, gethostbyname() returns just one ip of the host even though the host  could resolve to multiple IPs from a given location.

 

  • The returned IP address is an IPv4 address.  "

You a probably receiving the wired IP address right?

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: