File-Based Name Resolution


One of the easiest ways to ensure that name resolution is working is to hardcode it into the local files that Windows first looks to for information. By entering the information in the local files, you can ensure that the computer does not attempt to resolve the name and will use the address you've specified. Two files are used for name resolution. The first file, the hosts file, resolves IP names into IP addresses and can be thought of as an alternative to DNS. The second file, the lmhosts file, resolves NetBIOS names into IP addresses and can be thought of as an alternative to WINS. In the following sections, we examine these files and how you can use them to troubleshoot.

hosts

In the last chapter, you learned that the first name resolution solution on the Internet used a host file and that DNS was added later. On a Windows Server 2003 computer, the hosts file is located in the %windir%\system32\drivers\etc folder. This is the file you must modify to change the hard-coded host resolution. Entries in the hosts file are simple; they begin with the IP address and are followed by the host name. If you open the hosts file on your system, you will see that it already contains the special localhost name, which you can use as a template for adding new names.

After you make your changes, you do not need to reboot the system. Windows Server 2003 will detect the change to the file and will automatically use it, although it's never a bad idea to run the ipconfig /flushdns command after making modifications to the file.

lmhosts

lmhosts is short for LAN Manager Hosts. It's one of the few places in which Windows Server 2003 truly shows its OS/2 LAN Manager heritage. The format of the lmhosts file is different from the hosts file, but it is located in the same %windir%\system32\drivers\etc directory as the hosts file. Unlike the hosts file, no default lmhosts file is created when you install Windows Server 2003. However, Windows Server 2003 includes an lmhosts.sam file that is a sample file that you can rename to lmhosts and use as a starting point.

The lmhosts file is similar to the hosts file, except that it has these additional options:

  • #PRE Placed after an entry, it causes the entry to be preloaded. The effect of this is that the entry is permanently loaded into memory. This is a good idea for hosts that will be accessed frequently.

  • #DOM:<domain> Associates an entry with the domain given. Helps the computer locate a domain controller for the network.

  • #INCLUDE<filename> Includes the named file as if it were located in the lmhosts file. This is infrequently used because there is additional overhead to process the file.

In general, you must know that the lmhosts file is used for NetBIOS name resolution and that the hosts file is used for IP name resolution.




MCSA(s)MCSE 70-291(c) Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure
MCSA/MCSE 70-291: Implementing, Managing, and Maintaining a Microsoft Windows Server 2003 Network Infrastructure (Exam Prep)
ISBN: 0789736497
EAN: 2147483647
Year: 2006
Pages: 196
Authors: Will Schmied

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net