Name resolution using the Internet domain name system begins with the client-side resolver. The resolver is a set of routines that are built into the resolver library. The client resolver code is controlled by the following files:

Files Controlling the Client Resolver Code

File

Description

/etc/resolv.conf

Contains directives to specify the scope of a query

/etc/nsswitch.conf

Contains the reference to DNS for the hosts entry

During the system identification phase of a Solaris 10 OS installation, you use several windows to configure the name service. You use function keys or the Escape key to continue through the different windows, depending on the type of installation. For this demonstration, the Escape keys are used.

The installation window only allows the selection of DNS with the default of local files for the name service. Therefore, to use DNS with another name service, such as NIS or LDAP, you must manually modify the configuration files after the system is configured.

The instructions for editing the DNS client configuration files are as follows:

Editing the /etc/resolv.conf File

The /etc/resolv.conf file contains configuration directives for the DNS resolver. The directives include:

Configuration Directives in the /etc/resolv.conf File

Directive

Description

nameserver

Specifies the IP address of a name server for the DNS domain in which the host is located. You can list up to three name servers, one on each line.

domain

Specifies the local domain name. Specifying the local domain name allows queries using just the host name.

search

Provides a list of domain names, separated by spaces or tabs, that is appended to unqualified name queries until a match is found. When used without the presence of the domain directive, the first domain listed in the search list is the local domain.

Domain and search are both valid directives used in the /etc/resolv.conf file, and if both appear together, the last directive listed is used.

The following resolv.conf example shows two name servers for the suned.sun.com domain. It also specifies two domain names, training.sun.com, and sun.com, to append to any requests received that are not fully qualified.

# cat /etc/resolv.conf
nameserver 192.168.10.11
nameserver 192.168.20.88
domain suned.sun.com training.sun.com sun.com

Copying the /etc/nsswitch.dns File to the /etc/nsswitch.conf File

To configure a client to use DNS in combination with the system’s local files, copy the /etc/nsswitch.dns file to the /etc/nsswitch.conf file. This action only changes the hosts entry as follows:

# cat /etc/nsswitch.conf

hosts: files dns
Note: If you want to add DNS name resolution to a system currently running a name service, such as NIS or NIS+, you cannot copy a nsswitch template into the nsswitch.conf file. You must manually edit the current nsswitch file, and place the dns keyword on the hosts line in the specific location, along with other keywords.

The following example shows that DNS is queried after NIS and the /etc/hosts file.

# cat /etc/nsswitch.conf

hosts:  files nis dns

Related Posts:

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word