You are on page 1of 6

Introduction

In order to configure networking after installing Solaris, several files will


need to be created and/or modified. This document provides a quick
overview of those files along with example configuration data.

In most cases, the installation process performs all necessary configuration


tasks. One of the tasks generally not performed by the installer is updating
the Solaris networking files.

I have not found an easy way to force the installation program to configure
all local networking files if the "Naming Services" section fails. For
example, if you select the DNS naming service and the machine you are
configuring is not entered in DNS, the installation process will skip this
section. In cases like this, it will be necessary to update several of the files
that pertain to networking. The following is a list of those files and the
content that should be provided. Keep in mind that the system will need to
be rebooted after making changes (and creating) these files.

/etc/resolv.conf

During the Solaris installation program, you are prompted for Naming
Configuration information. In most cases, we use DNS. But during the
installation process, if the installer is unable to communicate with and/or
resolve your newly configured host with DNS, the Naming Configuration
will fail, and none of the configuration files (i.e. /etc/resolv.conf) will
not be updated. I often find it necessary to manually create the
/etc/resolv.conf with any name service information.

nameserver 63.67.120.18
nameserver 63.67.120.23

/etc/resolv.conf

/etc/hostname.interface

The Solaris installation program creates this file for you. 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 single entry
alexprod.

alexprod

/etc/hostname.eri0
/etc/nodename

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.

alexprod

/etc/nodename

/etc/defaultdomain

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 iDevelopment.info.

idevelopment.info

/etc/defaultdomain

/etc/defaultrouter

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 192.168.1.1, then this is the
entry that should be put into the file /etc/defaultrouter.

192.168.1.1

/etc/defaultrouter

/etc/hosts

The hosts database contains the IP addresses and host names of machines
on your network.

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.

#
# Internet host table
#
127.0.0.1 localhost
192.168.1.102 alexprod alexprod.idevelopment.info loghost

/etc/hosts

/etc/inet/netmasks

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.

#
# The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-number netmask
#
# The term network-number refers to a number obtained from the
Internet Network
# Information Center. Currently this number is restricted to being
a class
# A, B, or C network number. In the future we should be able to
support
# arbitrary network numbers per the Classless Internet Domain Routing
# guidelines.
#
# Both the network-number and the netmasks are specified in
# "decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
192.168.1.0 255.255.255.0

/etc/inet/netmasks

/etc/nsswitch.conf

The /etc/nsswitch.conf file defines the search order of the network


databases (hosts, netmasks, ethers, bootparams, protocols, services,
networks).
The Solaris installation program creates a default /etc/nsswitch.conf
file for the local machine, based on the name service you indicate during
the installation process. The installation process also creates 5 template
files that can be copied over to /etc/nsswitch.conf:

• nsswitch.files
• nsswitch.nis
• nsswitch.dns
• nsswitch.ldap
• nsswitch.nisplus

If you selected the 'None' option, indicating local files for name service,
the resulting /etc/nsswitch.conf file resembles the following example:

#
# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet"
transports.

passwd: files
group: files
hosts: files
ipnodes: files
networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system
will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files
printers: user files

auth_attr: files
prof_attr: files
project: files

/etc/nsswitch.conf - Default if you are using local files

Here is another /etc/nsswitch.conf file that adds a dns entry for hosts::
#
# /etc/nsswitch.dns:
#
# An example file that could be copied over to /etc/nsswitch.conf;
it uses
# DNS for hosts lookups, otherwise it does not use any other naming
service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet"
transports.

passwd: files
group: files

# You must also set up the /etc/resolv.conf file for DNS name
# server lookup. See resolv.conf(4).
hosts: files dns
ipnodes: files
# Uncomment the following line and comment out the above to resolve
# both IPv4 and IPv6 addresses from the ipnodes databases. Note that
# IPv4 addresses are searched in all of the ipnodes databases before
# searching the hosts databases. Before turning this option on,
consult
# the Network Administration Guide for more details on using IPv6.
#ipnodes: files dns

networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system
will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
sendmailvars: files
printers: user files

auth_attr: files
prof_attr: files
project: files

/etc/nsswitch.conf - Adding a dns database for the hosts: element

Here is another /etc/nsswitch.conf file that uses a combination of files,


nis, and dns entries:

# /etc/nsswitch.nis:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet"
transports.

# the following two lines obviate the "+" entry in /etc/passwd and
/etc/group.
passwd: files nis
group: files nis

# consult /etc "files" only if nis is down.


hosts: files dns nis
ipnodes: files
# Uncomment the following line and comment out the above to resolve
# both IPv4 and IPv6 addresses from the ipnodes databases. Note that
# IPv4 addresses are searched in all of the ipnodes databases before
# searching the hosts databases. Before turning this option on,
consult
# the Network Administration Guide for more details on using IPv6.
#ipnodes: nis [NOTFOUND=return] files

networks: nis [NOTFOUND=return] files


protocols: nis [NOTFOUND=return] files
rpc: nis [NOTFOUND=return] files
ethers: nis [NOTFOUND=return] files
netmasks: nis [NOTFOUND=return] files
bootparams: nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files

netgroup: nis

automount: files nis


aliases: files nis

# for efficient getservbyname() avoid nis


services: files nis
sendmailvars: files
printers: user files nis

auth_attr: files nis


prof_attr: files nis
project: files nis

/etc/nsswitch.conf - Using a combination of files, nis, and dns databases

You might also like