Go to main content

Configuring and Managing Network Components in Oracle® Solaris 11.4

Exit Print View

Updated: January 2019
 
 

How to Configure a DNS Client in Oracle Solaris

Before You Begin

Ensure that your role has the appropriate rights profile to perform this procedure. See Using Rights Profiles to Perform Network Configuration.

  1. Prepare a list of domains to search and the IP addresses of the DNS name servers on your network.
  2. Set properties in the SMF repository with the information from the previous step.

    For example:

    $ svccfg -s network/dns/client
    svc:/network/dns/client> setprop config/search = astring: ("domain1" "domain2")
    svc:/network/dns/client> setprop config/nameserver = net_address: (address1 address2)
    svc:/network/dns/client> select network/dns/client:default
    svc:/network/dns/client:default> refresh
    svc:/network/dns/client:default> validate

    domain* refers to domain names such as example.com, sales.my-example.com, and so on. address* are IP addresses of your DNS servers.

  3. Specify the name service switch to use DNS.
    svc:/network/dns/client:default> select name-service/switch
    svc:/system/name-service/switch> setprop config/host = astring: "files dns"
    svc:/system/name-service/switch> select system/name-service/switch:default
    svc:/system/name-service/switch:default> refresh
    svc:/system/name-service/switch:default> validate
    svc:/system/name-service/switch:default> quit
    
  4. Start the services that are needed to run the DNS client.
    $ svcadm enable dns/client
    $ svcadm enable name-service/switch
  5. Verify that the DNS configuration is properly set.

    Various methods are available. The following list is only partial.

    • Check for known domains.

      $ dig knownserver.example.com
    • Start a lookup process of known domains.

      $ nslookup
      > www.oracle.com
      information displayed
      > exit
      $
    • Open a browser and type a known URL to access a site.

Example 9  Setting Multiple DNS Options for a Client Simultaneously

The following example shows how to set multiple /etc/resolv.conf options simultaneously.

$ svccg
svc:> select /network/dns/client
svc:/network/dns/client> setprop config/options = "ndots:2 retrans:3 retry:1"
svc:/network/dns/client> listprop config/options
config/options astring     ndots:2 retrans:3 retry:1
svc:/network/dns/client> exit
$ svcadm refresh dns/client
$ grep options /etc/resolv.conf
options ndots:2 retrans:3 retry:1