# 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
Asegúrese de actualizar el servicio para que se apliquen los cambios.
El primer comando actualiza la información de configuración del DNS en el repositorio SMF.
# 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
El comando dig cuando se lo utiliza solo, comprueba que el cliente DNS esté activado. El comando getent hosts comprueba que el cliente DNS utilice el archivo /etc/nsswitch.conf.
En el siguiente ejemplo, se muestra cómo debería definir múltiples opciones de /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