How to Enable a DNS Client
-
Become an administrator.
-
List the domains to search and the IP addresses for the DNS name servers, then update the SMF
repository. For example:
# 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.0.2.10 192.0.2.11)
svc:/network/dns/client> select network/dns/client:default
svc:/network/dns/client:default> refresh
svc:/network/dns/client:default> quit
Make sure to refresh the service for the changes to take effect.
-
Update the name service switch information to use DNS.
The first command updates the DNS configuration information in the SMF repository.
# 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
-
Start the services that are needed to run the DNS client.
# svcadm enable network/dns/client
# svcadm enable system/name-service/switch
-
Verify that the DNS client is enabled by using one or both of the following commands:
# dig knownserver.example.com
# getent hosts knownserver.example.com
The dig command when used alone checks that the DNS client is enabled. The
getent hosts command verifies the /etc/nsswitch.conf file's
use of the DNS client.
Example 16 Setting Multiple DNS Options for a Client Simultaneously
The following example shows how you would set multiple
/etc/resolv.conf
options.
# 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
No comments:
Post a Comment