Wednesday, April 23, 2008

Windows, Linux, and Mac Hosts File Modifications

Overview

Palace servers periodically try to connect to a directory server that is no longer there. With Unix and Linux servers, this results in nothing more than a few extra log entries. However, Windows and Mac servers can experience some lag when the server is trying to make this connection. To eliminate lag from this source, and to be listed on the new Live Directory at Palacetools.com, you can create or modify a Hosts file.

Windows

  • Locate the file "Hosts" on your computer:

    Windows 95/98/Me  c:\windows\hosts
    Windows NT/2000/XP Pro  c:\winnt\system32\drivers\etc\hosts
    Windows XP Home c:\windows\system32\drivers\etc\hosts

    (you may need administrator access for Windows NT/2000/XP)

    NOTE: Hosts is the name of the hosts file and not another directory name. It does not have an extension (extensions are the .exe, .txt, .doc, etc. endings to filenames) and so appears to be another directory in the example above.

    You may have a file called "Hosts.sam". This file is a sample Hosts file (the .sam stands for sample) and can be used by removing the .sam extension so the name is just "Hosts". This file should be edited with a text editor, such as Notepad, and not a word processor, such as Microsoft Word. Use whatever you normally use to edit your cyborg.ipt or pserver.pat file.

  • Add this line to the Hosts file:
        71.155.186.91     directory.thepalace.com
  • Save your changes.
  • Reboot your computer.
  • Your server should now "register" with the Live Directory at palacetools.com.
  • If your Hosts file already contains an entry for directory.thepalace.com, then remove that entry. The above entry would be used in place of, and not in addition to any other directory.thepalace.com entry.

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.

Linux

  • Edit the hosts file on your system. The hosts file is usually found in
  • /etc/hosts
  • Add this entry to the Hosts file:
  •         71.155.186.91     directory.thepalace.com
  • Now make sure this file is used for host name lookups. This is done in two files. First is:
  • /etc/host.conf

This file should have at least the line shown below:
order hosts,bind
That has host lookups use the hosts file before doing a DNS query with bind.

  • The next file is:
  • /etc/nsswitch.conf

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.

  • There is no need to reboot your system. Just restart your palace pservers.
  • Start up your palace.
  • It should now "register" with the Live Directory at palacetools.com.

NOTE: The above configuration instructions were tested with a linux 4.5.1 Palace server, and should also work with the linux 4.4.1 server. The 4.3.2 linux server did not respond to the above configuration when tested. Older versions were not tested.

Macintosh OS X

  • With Macintosh OS X, the procedure is similar to Linux above. The hosts file can be found in
  • /etc/hosts

Macintosh OS 9

  • Look in System Folder:Preferences, and in the System Folder itself, and see if you have a file named "Hosts". If not, create one in a text editor.
  • Add these entries to the Hosts file:
  •         paps.thepalace.com          A     127.0.0.1
            directory.thepalace.com     A     71.155.186.91
  • Spaces should work, but it is recommended that you separate the three entries on each line by tabs. The first line is the one that makes sure your downloads work, and the second line is the one that redirects your server's reporting information. Place the Hosts file in System Folder:Preferences and reboot your Mac. Start up your palace. It should now "register" with the Live Directory at palacetools.com.

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.

No comments: