Solaris‎ > ‎11‎ > ‎

Configuring Naming Services by Using SMF


root@sol01:~# svccfg
svc:> select dns/client
svc:/network/dns/client> setprop config/search = astring: ("us.company.com" "eu.company.com" "companya.com" "companyb.com" "company.com" )
svc:/network/dns/client> setprop config/nameserver = net_address: (192.168.163.2 8.8.8.8 8.8.4.4)
svc:/network/dns/client> select dns/client:default
svc:/network/dns/client:default> refresh
svc:/network/dns/client:default> validate
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>
svc:/system/name-service/switch:default> exit

root@sol01:~# svcadm enable dns/client
root@sol01:~# svcadm refresh name-service/switch
root@sol01:~# grep host /etc/nsswitch.conf
hosts:  files dns

root@sol01:~# 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.

search  us.company.com eu.company.com companya.com companyb.com company.com
nameserver      192.168.163.2
nameserver      8.8.8.8
nameserver      8.8.4.4

root@sol01:~# ping google.com
google.com is alive


Comments