2.4 Creating the List of other LAN Hosts(/etc/hosts)

The final step in configuring the LAN side of the FreeBSD system is to create a list of the names and TCP/IP addresses of the various systems that are connected to the Local Area Network. This list is stored in the '/etc/hosts' file.

The default version of this file has only a single host name listing in it: the name and address of the loopback device ('lo0'). By networking convention, this device is always named "localhost" and always has an IP address of 127.0.0.1. Section 2.2.

To edit the /etc/hosts file enter the following command:

     # ee /etc/hosts


Scroll all the way to the bottom of the file (paying attention to the comments along the way; there is some good information there!) and enter (assuming our sample network) the following IP addresses and host names:

    192.168.1.1    curly  curly.my.domain  # FreeBSD System
    192.168.1.2    larry  larry.my.domain  # Windows '95 System
    192.168.1.3    moe    moe.my.domain    # Windows for Workgroups
    System
    192.168.1.4    shemp  shemp.my.domain  # Windows NT System


(No changes are needed to the line for the '127.0.0.1 localhost' entry.)

Once you have entered these lines, press the 'Esc' key to invoke the control menu. Select "leave editor" and be sure to select "save changes" when prompted.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.