Name and Address Resolution
Windows Sockets applications generally use the gethostbyname() function to resolve a host name to an IP address. The gethostbyname() function uses the following (default) name look-up sequence:
Checks the local host name for a matching name.
Checks the hosts file for a matching name entry.
If a Domain Name Server is configured, it queries it.
If no match is found, try NetBIOS name-resolution until the point at which DNS resolution is attempted.
Some applications use the gethostbyaddr() function to resolve an IP address to a host name. The gethostbyaddr() call uses the following (default) sequence:
Check the host's file for a matching address entry.
If a Domain Name Server is configured, it queries it.
Send a NetBIOS Adapter Status Request to the IP address being queried. If it responds with a list of NetBIOS names registered for the adapter, parse it for the computer name.
|