Solaris 11 – How to configure resolv.conf and nsswitch.conf

Solaris 11 is very different from Solaris 10. Previously in Solaris 10, all the configurations are inside a text file. So, you just need to edit,save and restart the services. But in Solaris 11, they are using SMF service to perform the configuration. So, it is all in command line.

For configuration files like resolv.conf and nsswitch.conf, DO NOT manually edit them. It will NOT work at all.

Original nsswitch.conf file

# cat /etc/nsswitch.conf

 # _AUTOGENERATED_FROM_SMF_V1_
 #
 # WARNING: THIS FILE GENERATED FROM SMF DATA.
 # DO NOT EDIT THIS FILE. EDITS WILL BE LOST.
 # See nsswitch.conf(4) for details.
 group: files
 hosts: files dns
 ipnodes: files dns
 networks: files
 printers: user files

Original resolv.conf file

# cat /etc/resolv.conf

# _AUTOGENERATED_FROM_SMF_V1_

#

# WARNING: THIS FILE GENERATED FROM SMF DATA.

# DO NOT EDIT THIS FILE. EDITS WILL BE LOST.

# See resolv.conf(4) for details.

nameserver 10.4.5.254

nameserver 10.4.6.253
 

# svcs -a | grep dns
 disabled Nov_12 svc:/network/dns/multicast:default
 disabled Nov_12 svc:/network/dns/server:default
 online Nov_12 svc:/network/dns/client:default
# svccfg -s dns/client
 svc:/network/dns/client> listprop config
 config application
 config/value_authorization astring solaris.smf.value.name-service.dns.client
 config/nameserver net_address 10.4.5.254 10.4.6.253
 svc:/network/dns/client> setprop config/nameserver = (10.1.2.254 10.1.2.254)
 svc:/network/dns/client> setprop config/domain = sing.seagate.com
 svc:/network/dns/client> listprop config
 config application
 config/value_authorization astring solaris.smf.value.name-service.dns.client
 config/nameserver net_address 10.1.2.254 10.1.2.254
 config/domain astring sing.seagate.com
 svc:/network/dns/client> exit

# svcadm refresh dns/client # svcadm restart dns/client

New resolv.conf file

# cat /etc/resolv.conf
#
 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
 #
#
 # _AUTOGENERATED_FROM_SMF_V1_
 #
 # WARNING: THIS FILE GENERATED FROM SMF DATA.
 # DO NOT EDIT THIS FILE. EDITS WILL BE LOST.
 # See resolv.conf(4) for details.

domain domain.com

nameserver 10.1.1.254

nameserver 10.1.2.254

# svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/host = “files dns”
svc:/system/name-service/switch> setprop config/ipnode = astring: “files dns”
svc:/system/name-service/switch> exit
 # svcadm refresh name-service/switch
 # svcadm restart name-service/switch

 #cat /etc/nsswitch.conf
#
 # Copyright (c) 1991, 2012, Oracle and/or its affiliates. All rights reserved.
 #
#
 # _AUTOGENERATED_FROM_SMF_V1_
 #
 # WARNING: THIS FILE GENERATED FROM SMF DATA.
 # DO NOT EDIT THIS FILE. EDITS WILL BE LOST.
 # See nsswitch.conf(4) for details.
 passwd: files
 group: files
 hosts: files dns
 ipnodes: files dns
 networks: files
 protocols: files
 printers: user files

Hope that helps!!

Advertisements

7 thoughts on “Solaris 11 – How to configure resolv.conf and nsswitch.conf”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s