Adding the system name to the HOSTS file

If you are not using a domain name server, you need to add the IBM® i name with which you want to communicate to the HOSTS file in order to identify your system to the network.

You also need to add the IBM i NetServer server name to the LMHOSTS file if you are relying on IBM i NetServer for file and print serving. For instructions on updating your LMHOSTS file, see Configure the PC for IBM i NetServer Use.

To create or change the HOSTS file, do the following:
Note: The directory in the following examples could be \winnt\system32 instead of \windows\system32 for some Windows operating systems.
  1. Open a command prompt.
  2. Change to the directory that should contain the HOSTS file, the directory in which the HOSTS file must remain. For example:
    c:\>cd \windows\system32\drivers\etc
  3. Optional: If a file named HOSTS already exists in this directory, skip this step. Create a file named HOSTS by copying the sample file (supplied by the Windows operating system). The file is in the same directory and is called hosts.sam.
    For example:
    c:\windows\system32\drivers\etc>copy hosts.sam hosts
  4. Edit the HOSTS file. For example:
    c:\windows\system32\drivers\etc>edit hosts

    Follow the instructions in the HOSTS sample file to add the IP address and name of the IBM i platform to which you want to connect.

  5. Save the HOSTS file.
    Note: For PC5250, if you do not use a name server or hosts table, you cannot start the 5250 emulator delivered with IBM i Access for Windows. The left bottom corner of your emulation display indicates a 657 communication error (Resolving TELNET 5250 server host-domain name).

    You can choose to use a HOSTS file if you have only a few machines using TCP/IP. This requires that you maintain an up-to-date list on each computer. When an IBM i address changes, you must change the HOSTS file entry if one exists.