The HOSTS file is an ASCII text file that contains a list of the servers and their IP addresses. However, use of the HOSTS file is not a requirement for the Broker. The use of the HOSTS file depends on the way the local area network (LAN) is implemented and managed at a site. Clients can bypass the HOSTS file and use DNS, DHCP (Dynamic Host Configuration Protocol), or WINS (Windows Name Service).
To modify or add servers to the HOSTS file, edit the file using a text editor (e.g., Microsoft Notepad).
The following table illustrates where you can find this file based on your client Windows operating system (OS):
Version of Windows OS File (Location and Name)
Windows 95 C:\WINDOWS\HOSTS
Windows NT 3.51 C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
Windows NT 4.0 C:\WINNT\SYSTEM32\DRIVERS\ETC\HOSTS
A sample of the Windows 95 HOSTS file (i.e., C:\WINDOWS\HOSTS.SAM) is displayed below (modifications/additions made to this sample file are italicized):
# Copyright (c) 1994 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Chicago # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # # IP Host # ADDRESS Name Description # | | | # | | | # V V V 127.0.0.1 localhost # loopback 192.1.1.1 BROKERSERVER # Broker Server
The last entry in this file (i.e., "BROKERSERVER") was added to the sample HOSTS file for illustration purposes. We recommend you put in an entry that points to the main server you intend using with the Broker the majority of the time (e.g., BROKERSERVER). VISTA applications can specify any server they wish.
Adding Entries:
To add entries in the HOSTS file:
a. Move the cursor to the end of the last line displayed in the file.
b. Press the Enter Key to create a new line.
c. On the new line, enter the desired IP address beginning in the first column, as described in the example above. As recommended, add an appropriate IP address for the BROKERSERVER Host name as the next entry below "127.0.0.1".
d. After typing the IP address, type at least one space and enter the Host name that corresponds to that IP address. As recommended, type in BROKERSERVER as the next entry below "loopback".
For example, the entry for a server at your site with an IP address of 192.1.1.1 would look like the following:
127.0.0.1 localhost # loopback <---existing entry 192.1.1.1 BROKERSERVER # Broker Server <---added entry
e. Repeat steps a - d until you have entered all of the IP addresses and corresponding Host names you wish to enter.
f. When your entries are complete, use Notepad's File | Save command to save the HOSTS file.
Do not save the HOSTS file with an extension!
g. Close the HOSTS file.
Modifying Entries:
To modify entries in the HOSTS file:
a. Move the cursor to the line to be modified.
b. Modify the IP address, Host name, or both. Make sure that at least one space separates the IP address from the corresponding Host name. Make sure you have an entry for BROKERSERVER in this file.
c. Repeat steps a - b until you have modified all of the IP addresses and corresponding Host names you wish to change.
d. When your entries are complete, use Notepad's File | Save command to save the HOSTS file.
Do not save the HOSTS file with an extension!
e. Close the HOSTS file.