Search This Blog

Thursday, 30 November 2017

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.
[code]
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
[/code]
Configure DNS client configuration with required values
[code]
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.mobily.lan
svc:/network/dns/client> setprop config/search = prod.mobily.lan
svc:/network/dns/client> exit
[/code]
Restart the service
[code]
root@eecsaruh2hoc007 # svcadm refresh dns/client # svcadm restart dns/client
[/code]
Verify the change:
[code]
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.mobily.lan
search  prod.mobily.lan
nameserver      10.14.10.13
nameserver      10.14.10.14
nameserver      10.64.10.13

[/code]


[b]Setting up nsswitch conf.[/b]
Ensure, name-service service is online
Change the properties based on your requirements
[code]
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
[/code]
Restart name-service service
[code]
root@eecsaruh2hoc007 # svcadm refresh name-service/switch
root@eecsaruh2hoc007 # svcadm restart  name-service/switch
[/code]

Verify the change:
[code]
root@eecsaruh2hoc007 # grep dns /etc/nsswitch.conf
hosts:  files dns
ipnodes:        files dns
[/code]

No comments:

Post a Comment