The hosts File

A hosts file provides similar functionality to lmhosts. This static text file also must be in \winnt\system32\drivers\etc. Although its syntax is similar to lmhosts, it is used to map hostnames, whereas lmhosts is used to map NetBIOS names. A sample hosts file appears in Listing 8.3.

Code Listing 8.3. Using a hosts File to Map DNS Names to IP Addresses
C:\WINNT\system32\drivers\etc>type hosts
192.168.2.200   server11.fis.local server11 dc
192.168.2.199   server12.fis.local server12

Tip

Make sure your text editor is not automatically appending a file extension to either the lmhosts or hosts file. If, for example, Notepad saves your hosts file as hosts.txt, it will not function.

ipconfig

Notice from the lines of the hosts file in ...

Get Special Edition Using Microsoft Active Directory now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.