Previous Page | Next Page

  1. Introduction
  2. OSI Layers
  3. Addresses
  4. SNMP
  5. Network Tools
  6. Routing
  7. ARP
  8. WINS
  9. DNS
  10. NIS
  11. DHCP
  12. Name Resolution
  13. RAS
  14. Connections
  15. Test Pointers
  16. Items to remember
  17. Terms
  18. Credits

Name Resolution

HOST Names

Characteristics:

  • Can be up to 256 characters
  • Host name may be the same or different than the NetBIOS name.
  • No longer case sensitive.
  • A host can have several host names.

Name Resolution Order

Two types of resolution are specific and standard. Microsoft resolves names two ways depending on whether the name is a TCP/IP host name or NetBIOS name. NetBIOS name resolution order for NetBIOS H-node:

  1. NetBIOS name cache - Standard
  2. WINS (3 attempts) - Standard
  3. NetBIOS b-node broadcast - Standard
  4. lmhosts file - Specific.
  5. hosts file - Specific.
  6. DNS - Specific. Request sent at 5, 10, 20, 40, 5, 10, and 20 seconds.

If name resolution is accomplished at any step, no other methods are continued. NetBIOS Name resolution for M-node:

  1. NetBIOS name cache - Standard
  2. NetBIOS b-node broadcast - Standard
  3. lmhosts file - Specific.
  4. WINS (3 attempts) - Standard
  5. hosts file - Specific.
  6. DNS - Specific. Request sent at 5, 10, 20, 40, 5, 10, and 20 seconds.

NetBIOS name resolution for P-node:

  1. NetBIOS name cache - Standard
  2. WINS (3 attempts) - Standard
  3. hosts file - Specific.
  4. DNS - Specific. Request sent at 5, 10, 20, 40, 5, 10, and 20 seconds.

NetBIOS name resolution for B-node:

  1. NetBIOS name cache - Standard
  2. NetBIOS b-node broadcast - Standard
  3. lmhosts file - Specific.
  4. hosts file - Specific.
  5. DNS - Specific. Request sent at 5, 10, 20, 40, 5, 10, and 20 seconds.

TCP/IP host name resolution order:

  1. local name
  2. hosts file - Specific.
  3. DNS - Specific. Request sent at 5, 10, 20, 40, 5, 10, and 20 seconds.
  4. WINS - specific.
  5. 3 NetBIOS b-node broadcasts - Standard
  6. lmhosts file - Specific. If entries in this file contain the entry "#PRE", the value of that line is loaded into the NetBIOS name cache memory and broadcasts will not be used to resolve these host name to IP addresses. When TCP/IP is initialized the lines with #PRE are loaded into memory. #INCLUDE statements may be used to embed one lmhosts file locally or on a remote computer into the main lmhosts file. Keywords:
    • #PRE - Preload the line information into memory (NetBIOS name cache).
    • #DOM - Domain name. Indicates that this machine is a domain controller. This prevents a broadcast from being sent to find the domain controller when changing a password or a user is logging onto a domain.

    Used as follows:

    192.168.10.13 computer-name #PRE #DOM: domain-name

Five NBT Name Resolution Methods

  • B-node - broadcast - Uses UDP broadcast datagrams. Default node type.
  • P-node - Peer to peer - Uses a NetBIOS name server such as WINS. If a WINS server is not available, broadcasts are not used as a backup. The WINS IP address must be specified at each client?
  • M-node - Mixed - Tries B-node, then P-node resolution.
  • H-node - Hybrid - Tries P-node, then B-node resolution.
  • Microsoft enhanced B-node - Checks address cache which is loaded brom the lmhosts file when the system boots. After checking address cache, a broadcast is sent, then the lmhost file is checked if broadcasting did not resolve the query.

LMHOSTS File

The lmhosts file is in NTROOT\System32\Drivers\etc\lmhosts.sam. If entries in this file contain the entry "#PRE", the value of that line is loaded into the NetBIOS name cache memory and broadcasts will not be used to resolve these host name to IP addresses. When TCP/IP is initialized the lines with #PRE are loaded into memory. The #PRE entry lines should be near the bottom of the file. #INCLUDE statements may be used to embed one lmhosts file locally or on a remote computer into the main lmhosts file. Shared lmhosts must be accessable to all users. Regedit32 can be used to make a share accessible to a null user. The names of the shares can be added to the following registry entry:

\HKey_Local_Machine\System\CurrentControlSet\Services\LanmanServer\Parameters\NullSessionShares

The NBSTAT - R command could be used from a login script to load the additional remote lmhosts file(s). LMHOSTS file keywords:

  • #BEGIN_ALTERNATE and #END_ALTERNATE - Alternate locations for lmhosts files. Subsequent entries are only checked if the initial computers are not available.
  • #DOM domain name - Indicates that this machine is a domain controller. This prevents a broadcast from being sent to find the domain controller when changing a password or a user is logging onto a domain.
  • #NOFNR - No NetBIOS name queries for older LAN MANAGER based computers.
  • #INCLUDE - Used to embed one lmhosts file locally or on a remote computer into the main lmhosts file.
  • #MH - Multiple entries for a computer with multiple network cards or addresses.
  • #PRE - Preload the line information into memory(NetBIOS name cache).

Example:

192.168.20.33	Machine1
192.168.20.45	Machine2
192.168.20.3	Server1	#PRE
192.168.20.4	Server2	#PRE #DOM: MYDOMAIN

#INCLUDE \\ourserver\public\lmhosts
#INCLUDE \\nextserver\public\lmhosts

#BEGIN_ALTERNATE
#INCLUDE \\mainserver\public\lmhosts
#INCLUDE \\backupserver\public\lmhosts
#END_ALTERNATE

The benefits of using #PRE and #DOM in the LMHOSTS file allow non-WINS clients to do:

  • Registration
  • User account verification
  • Password changing

The #PRE entry prevents broadcasts from being made to access the host. The #DOM entry supports:

  • Domain validation
  • Account synchronization
  • Browsing

HOSTS File

Stored in \NTROOT\System32\drivers\etc. Host file characteristics:

  • An entry may be any valid string of up to 256 characters.
  • Commonly used names should be near the top.
  • Duplicate names are ignored.
  • Each line corresponds to 1 IP address.

Name Resolution on Segmented Networks without WINS

To allow each BDC on subnets to communicate with the PDC across a router:

Create an LMHOSTS file on each BDC with a PDC entry.

To get a workstation to be able to contact PDCs or BDCs in the domain:

Add a #PRE and #DOM entry in the workstation LMHOSTS file for each domain controller.

NetBIOS name service uses UDP port 137 so setting routers to forward NetBIOS broadcasts to UDP port 137 of a WINS server will allow NetBIOS name resolution.