- Save your changes.
- Once you are done with this entry you can delete the line from your Hosts file and save it.
NOTE: Windows users should verify that they are showing extensions for all file types. This will help verify that the Hosts file is named correctly. To reset Windows to show all file extensions, double click on My Computer. Go to View Menu (Win95/98/ME) or Tools Menu (Win2000/XP), and select Folder Options. Click the View tab. In the Files and Folders section, DESELECT (uncheck) the item named "Hide file extensions for known file types". Click Apply, and then click OK.
- Edit the hosts file on your system. The hosts file is usually found in
- Now make sure this file is used for host name lookups. This is done in two files. First is:
This file should have at least the line shown below:
That has host lookups use the hosts file before doing a DNS query with bind.
Recent tests indicate that this file is required in order for the pserver to use the entry in /etc/hosts. The nsswitch.conf file should have this line for the hosts configuration:
hosts: files nisplus nis dns
There will probably already be a similar line in your version of this file. Just make sure "files" comes before whatever other methods are listed.
Macintosh OS X
- With Macintosh OS X, the procedure is similar to Linux above. The hosts file can be found in
Macintosh OS 9
- Spaces should work, but it is recommended that you separate the three entries on each line by tabs. Place the Hosts file in System Folder:Preferences and reboot your Mac.
If you have an older Mac that is using MacTCP instead of Open Transport, try putting the Hosts file in the System Folder.
Note from the Apple Tech Info Library:
Open Transport TCP/IP automatically uses a Hosts file stored the Preferences folder of the active System Folder. If no Hosts file is found in the Preferences folder, Open Transport TCP/IP searches the active System Folder for a Hosts file.
This means that if you don't already have a Hosts file, and you just drop it in your System Folder and reboot, it will work. However, System Folder:Preferences is the default and recommended location for all systems using Open Transport.
- Additional Configuration Options
You can configure TCP/IP to use the contents of this new Hosts file, which will activate the Hosts file without having to reboot.
To do this:
- Open the TCP/IP control panel.
- Get into Advanced user mode by:
- selecting the User Mode command under the Edit menu.
- In the User Mode dialog select Advanced then click OK.
- Click on the Select Hosts File button.
- In the File Open file dialog that comes up, naviagate to and select the Hosts file you created.
- Click on OK if it asks you if you are sure you want to replace the Hosts File with the contents of the selected file.
- Close TCP/IP control panel and click OK to save the configuration.
The above procedure will copy the contents of the file selected into the Hosts file in the Preferences folder, or create one there if none exists.