Search This Blog

Wednesday 1 November 2017

Solaris 11 DNS Cient and nsswitch.conf configuration.

In solaris 11, its not recomented to edit resolv.conf file directory. Below is the proceedure to configure it.

Ensure, DNS client service is online.

root@eecsaruh2hoc007 # svcs -a | grep dns
disabled       Jun_25   svc:/network/dns/multicast:default
disabled       Jun_25   svc:/network/dns/server:default
online         Jun_25   svc:/network/dns/client:default

Configure DNS client configuration with required values

root@eecsaruh2hoc007 # svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (10.14.10.13 10.14.10.14 10.64.10.13)
svc:/network/dns/client> setprop config/domain = prod.example.lan
svc:/network/dns/client> setprop config/search = prod.example.lan
svc:/network/dns/client> exit

Restart the service

root@eecsaruh2hoc007 # svcadm refresh dns/client # svcadm restart dns/client

Verify the change:

root@eecsaruh2hoc007 # 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.

domain  prod.example.lan
search  prod.example.lan
nameserver      10.14.10.13
nameserver      10.14.10.14
nameserver      10.64.10.13




Setting up nsswitch conf
Ensure, name-service service is online
Change the properties based on your requirements



root@eecsaruh2hoc007 #  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> refresh
svc:/system/name-service/switch> exit

Restart name-service service

root@eecsaruh2hoc007 # svcadm refresh name-service/switch
root@eecsaruh2hoc007 # svcadm restart  name-service/switch


Verify the change:

root@eecsaruh2hoc007 # grep dns /etc/nsswitch.conf
hosts:  files dns
ipnodes:        files dns

No comments:

Post a Comment