TCP/IP Name Resolution

ID: q108295

The information in this article applies to:

SUMMARY

TCP\IP under Windows NT allows a computer to communicate over a network with another computer by using either an IP address, a host name, or a NetBIOS name. However, when one computer attempts to communicate with another computer using one of these three naming conventions, that name must ultimately be resolved to a hardware address. The following are the steps used by TCP\IP to resolve a host name and a NetBIOS name to a hardware address.

MORE INFORMATION

Host Name Resolution Using a Hosts File

1. Computer A enters a command using the host name of Computer B.

2. The HOSTS file on Computer A (contained in the

   %SystemRoot%\system32\drivers\etc directory ) is parsed. When the host
   name of Computer B is found, it is resolved to an IP address.

3. The Address Resolution Protocol (ARP) is then used to resolve the IP
   address of Computer B to its hardware address. If Computer B is on the
   local network, its hardware address will be obtained by using the ARP
   cache or by sending a local broadcast asking for a reply from Computer B
   with its hardware address. If Computer B is on a remote network, ARP
   will determine the hardware address of the default gateway for routing
   to Computer B.

NOTE: Host name resolution using a Domain Name Server (DNS) is similar to the steps outlined above. Instead of parsing the HOSTS file in Step 2, the DNS looks up the host name of Computer B in its database and resolves it to an IP address.

NetBIOS Name Resolution

1. Computer A enters a Windows NT command using the NetBIOS name of

   Computer B.

2. The NetBIOS name cache on Computer A is checked for the IP address that
   corresponds to the NetBIOS name of Computer B.

3. If the IP address of Computer B is found in the NetBIOS name cache, ARP
   will resolve the IP address to Computer B's hardware address (see Step 3
   of the Host Name Resolution Using A Hosts File section above). If,
   however, the NetBIOS name is not resolved from the NetBIOS name cache,
   Computer A broadcasts a name request with the NetBIOS address of
   Computer B.

4. If Computer B is on the local network, Computer A will receive a
   response to its name request broadcast containing the IP address of
   Computer B. ARP will then resolve Computer B's IP address to its
   hardware address.

5. If Computer B is on a remote network, Computer A will not receive a
   reply to its name request broadcast. The LMHOSTS file on Computer A
   (contained in the %SystemRoot%\system32\drivers\etc directory) is then
   parsed. If a mapping for the NetBIOS name of Computer B exists, it is
   resolved to its IP address. Since this is the IP address of a remote
   computer, ARP will determine the hardware address of the default gateway
   for routing to Computer B.

Additional query words: prodnt
Keywords          : kbnetwork
Version           : 3.1
Platform          : WINDOWS

Last Reviewed: August 17, 1998