Configure DNS services in Solaris 11 using SMF

With the introduction of Solaris 11, a lot of configuration has been moved from configuration files into the SMF. This is also true for the resolv.conf and nsswitch.conf used by DNS services.

View existing DNS client configuration

# svccfg -s network/dns/client listprop config
config                     application
config/value_authorization astring
config/domain              astring
config/nameserver          net_address

Defining DNS settings (resolv.conf)

DNS Name Servers

Update the SMF repository with a single DNS name server. Lets use as our example:

# svccfg -s network/dns/client setprop config/nameserver = net_address:

If we have multiple name servers, we specify all on the command-line. For example and for the primary and secondary DNS servers.

# svccfg -s network/dns/client setprop config/nameserver = net_address: (

Set domainname

In this example, we are setting the domainname to

# svccfg -s network/dns/client setprop config/domain = astring:

Add/Change the search domains

For this example, we are including and

# svccfg -s network/dns/client setprop config/search = astring: ""

Name Resolution order

Here we are defining our name resolution order to lookup local files and then DNS entries:

# svccfg -s name-service/switch setprop config/ipnodes = astring: "files dns"
# svccfg -s name-service/switch setprop config/host = astring: "files dns"

Update legacy files

The following commands will build an /etc/resolv.conf and /etc/nsswitch.conf based on your settings above:

# svcadm enable dns/client
# nscfg export svc:/network/dns/client:default
# svcadm refresh name-service/switch