Microsoft KB Archive/110703

{|
 * width="100%"|

INFO: Host Name May Map to Multiple IP Addresses

 * }

Q110703

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), versions 3.1, 3.5, 3.51, 4.0

-

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.

Additional query words:

Keywords : kbnetwork kbAPI kbOSWinNT310 kbOSWinNT350 kbOSWinNT351 kbOSWinNT400 kbSDKPlatform kbWinsock kbGrpDSNet

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch kbWin32SDK400 kbWin32SDK310 kbWin32SDK350 kbWin32SDK351