Solaris 11.3 – Bye bye resolv.conf

In the good old days, setting up DNS was just a quick edit of /etc/resolv.conf

like:

~# cat /etc/resolv.conf
search dracko.local
nameserver 192.168.128.130
nameserver 192.168.128.131

But in Solaris 11 you see this:

~# 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.

Soooooo, here is what you do:

root@dracko2:/# svccfg -s network/dns/client
svc:/network/dns/client> setprop config/search = astring: (“dracko.local”)
svc:/network/dns/client> setprop config/nameserver = net_address: (192.168.128.130 192.168.128.131)
svc:/network/dns/client> exit
root@dracko2:/# svcadm refresh dns/client
root@dracko2:/# svcadm restart dns/client

It Works!

root@dracko2:~# nslookup google.com
Server: 192.168.128.131
Address: 192.168.128.131#53

Non-authoritative answer:
Name: google.com
Address: 172.217.4.206

Now we do nsswitch.conf

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

#svcadm refresh name-service/switch

#svcadm restart name-service/switch

Leave a Reply

Your email address will not be published. Required fields are marked *