How to Add or Edit DNS servers in Sun Solaris

Domain Name Service (DNS) is a system which translates the meaningful Hostnames and Domain Names into valid IP Addresses. A DNS Client or a Resolver is a host or a network device which queries the DNS servers for various resource records like the IP Address for a host like a Mail Server.

If you configure your Solaris Server as a DNS client then you need to add the DNS servers which the resolver on the server query for various DNS records in the file

/etc/resolv.conf

The following is an example of a sample /etc/resolv.conf

$ cat /etc/resolv.conf

domain example.com
nameserver 10.10.10.1
nameserver 10.10.10.2
nameserver 10.10.10.3

search example.com example.co.uk example.net

where

domain – specifies the local domain. A search for a host in the domain can simply be done with the hostname without the Domain suffix.

nameserver – specifies the IP Address to it as a DNS server. There can be more than one DNS server specified by the nameserver keyword (one per line) listed in the file.

search – specifies a list of local domains to search for the hosts. This process is slow and generates a lot of traffic.

This is the most commonly found configuration on DNS clients or Resolvers. More advanced configurations include

sortlist – Sort the IP Addresses returned to the resolver
options –  Allows additional configurations to modify resolver variables.

For a detailed man page, click here

Leave a Comment

Your email address will not be published. Required fields are marked *