Configure Solaris for DNS Resolution of Hostnames

Solaris provides extensive control over the means of looking up various name services, including DNS. If DNS resolution of hostnames has not been setup, the nsswitch.conf file must be configured in addition to resolv.conf.


Once you have configured the DNS client settings in Solaris, you need to alter the /etc/nsswitch.conf file. This name services configuration file controls a variety of lookup types with several services including NIS/NIS+ and LDAP.

To configure your host to perform hostname lookups with DNS, modify the line that starts with hosts: to include the keyword dns. For example, if your /etc/nsswitch.conf file hosts line looks like the following:

hosts: files

then change it to read:

hosts: files dns

The order of keywords on this line indicates the order in which Solaris references the name services. The keyword files represents the /etc/hosts file.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

6 Responses to “Configure Solaris for DNS Resolution of Hostnames”

  1. February 10, 2009 at 4:59 pm, Kaushik said:

    This one works!

    Thanks!

    Reply

  2. April 17, 2009 at 6:45 am, safi said:

    worked for me on solaris 10 :) thanks

    Reply

  3. April 27, 2009 at 4:04 pm, Khannie said:

    thanks :)

    Reply

  4. August 05, 2009 at 5:56 pm, Brian said:

    simple resolution in dns with nsswitch.conf

    hosts files dns

    Reply

  5. April 21, 2010 at 10:07 am, Anonymous said:

    still i amnot able to get internet in my server

    Reply

  6. July 01, 2010 at 3:51 pm, Toqui said:

    Thanks, very clear!

    Reply

Leave a Reply

You may also like-

Solaris 10 Directory Server InstallationThis Tech-Recipe details an installation of Directory Server 5.2 p4 from Sun Microsystems into a Solaris 10 whole-root zone. Good DS installation instructions are ...