# svccfg -s network/dns/client svc:/network/dns/client> setprop config/search = astring: ("example.com" "sales.example.com") svc:/network/dns/client> setprop config/nameserver = net_address: (192.168.1.10 192.168.1.11) svc:/network/dns/client> select network/dns/client:default svc:/network/dns/client:default> refresh svc:/network/dns/client:default> quit
변경 사항을 적용하려면 서비스를 새로 고쳐야 합니다.
첫번째 명령은 SMF 저장소의 DNS 구성 정보를 업데이트합니다.
# svccfg -s system/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> quit
# svcadm enable network/dns/client # svcadm enable system/name-service/switch
# dig knownserver.example.com
# getent hosts knownserver.example.com
dig 명령은 단독으로 사용될 때 DNS 클라이언트가 사용으로 설정되었는지 확인합니다. getent hosts 명령은 DNS 클라이언트의 /etc/nsswitch.conf 파일 사용을 확인합니다.
다음 예에서는 여러 /etc/resolv.conf 옵션을 설정하는 방법을 보여줍니다.
# svccg svc:> select /network/dns/client svc:/network/dns/client> setprop config/options = "ndots:2 retrans:3 retry:1" svc:/network/dns/client> listprop config/options config/options astring ndots:2 retrans:3 retry:1 svc:/network/dns/client> exit # svcadm refresh dns/client # grep options /etc/resolv.conf options ndots:2 retrans:3 retry:1