Configuring TCP/IP on Solaris - TCP/IP Configuration Files

  Return to Networking Basics Home Page.


Each machine on a TCP/IP network gets its configuration information from the following TCP/IP configuration files and network databases:

The Solaris installation program creates these files as part of the installation process. You can also edit the files manually, as explained in this document. The hosts and netmasks databases are two of the network databases read by the name services available on Solaris networks.


This file defines the network interfaces on the local host. At least one /etc/hostname.interface file should exist on the local machine. The Solaris installation program creates this file for you. In the file name, interface is replaced by the device name of the primary network interface.

The file contains only one entry: the host name or IP address associated with the network interface. For example, suppose eri0 is the primary network interface for a machine called alexprod. Its /etc/hostname.interface file would have the name /etc/hostname.eri0; the file would contain the entry alexprod.

For Multiple Network Interfaces
If a machine contains more than one network interface, you must create additional /etc/hostname.interface files for the additional network interfaces. You must create these files with a text editor; the Solaris installation program does not create them for you.

For example, consider the machine melodyprod. It has two network interfaces and functions as a router. The primary network interface eri0 is connected to network 192.168.100. Its IP address is, and its host name is melodyprod. The Solaris installation program creates the file /etc/hostname.eri0 for the primary network interface and enters the host name melodyprod.

The second network interface is eri1; it is connected to network 192.168.200. Although this interface is physically installed on machine melodyprod, it must have a separate IP address. Therefore, you have to manually create the /etc/hostname.eri1 file for this interface; the entry in the file would be the router's name; melodyprod-200.


This file should contain one entry; the host name of the local machine. For example, on machine alexprod, the file /etc/nodename would contain the entry alexprod.


This file should contain one entry, the full qualified domain name of the administrative domain to which the local host's network belongs. You can supply this name to the Solaris installation program or edit the file at a later date.

Take for example the domain iDevelopment which was classified as a .info domain. In this example, /etc/defaultdomain should contain the entry


This file should contain an entry for each router directly connected to the network. The entry should be the name for the network interface that functions as a router between networks.

If the default router for a machine will be, then this is the entry that should be put into the file /etc/defaultrouter.

hosts Database

The hosts database contains the IP addresses and host names of machines on your network. If you use the NIS, NIS+, or DNS name services, the hosts database is maintained in a database designated for host information. For example, on a network running NIS+, the hosts database is maintained in the host table.

If you use local files for name service, the hosts database is maintained in the /etc/inet/hosts file. This file contains the host names and IP addresses of the primary network interface, other network interfaces attached to the machine, and any other network addresses that the machine must know about.

NOTE: For compatibility with BSD-based operating systems, the file /etc/hosts is a symbolic link to /etc/inet/hosts.

netmasks Database

You need to edit the netmasks database as part of network configuration only if you have set up subnetting on your network. The netmasks database consists of a list of networks and their associated subnet masks.
NOTE: When you create subnets, each new network must be a separate physical network. You cannot apply subnetting to a single physical network.

Adding a Subnet to a Network

If you are changing from a network that does not use subnets to one that is subnetted, perform the following steps:
  1. Decide on the new subnet topology, including considerations for routers and locations of hosts on the subnets.
  2. Assign all subnet and host addresses.
  3. Modify the /etc/inet/netmasks file, if you are manually configuring TCP/IP, or supply the netmask to the Solaris installation program.
  4. Modify the /etc/inet/hosts files on all hosts to reflect the new host addresses.
  5. Reboot all machines.

Last modified on: Saturday, 18-Sep-2010 17:27:44 EDT
Page Count: 5110