INFO: Host Name May Map to Multiple IP Addresses
Article ID: 110703
Article Last Modified on 10/17/1999
APPLIES TO
- Microsoft Win32 Software Development Kit (SDK) 3.1
- Microsoft Win32 Software Development Kit (SDK) 3.5
- Microsoft Win32 Software Development Kit (SDK) 3.51
- Microsoft Win32 Software Development Kit (SDK) 4.0
This article was previously published under Q110703
SUMMARY
The sockets function gethostname() returns a string that identifies the
name of the local host. Each host has only one "official" name,
regardless of how many IP addresses it has, but there may be several
"aliases" for the host.
In TCP/IP, there is not a one-to-one mapping between host name and IP
address. The mapping is one-to-many: one host name can have multiple IP
addresses.
The sockets function getsockname() returns the sockaddr that the socket
is bound to.
Keywords: kbinfo kbwinsock kbapi kbnetwork KB110703