Chapter 5 Network Preferences 41
Viewing or Changing DNS Servers
To view the DNS servers for port en0:
$ serversetup -getDefaultDNSServer (devicename|"portname")
To change the DNS servers for port en0:
$ sudo serversetup -setDefaultDNSServer (devicename|"portname") server1
[server2
] [...]
To view the DNS servers for a particular port or device:
$ serversetup -getDNSServer (devicename|"portname")
To change the DNS servers for a particular port or device:
$ sudo serversetup -setDNSServer (devicename|"portname") server1 [server2]
[...]
To list the DNS servers for a configuration:
$ sudo networksetup -getdnsservers "configuration"
To view the DNS search domains for port en0:
$ serversetup -getDefaultDNSDomain (devicename|"portname")
To change the DNS search domains for port en0:
$ sudo serversetup -setDefaultDNSDomain (devicename|"portname") domain1
[domain2
] [...]
To view the DNS search domains for a particular port or device:
$ serversetup -getDNSDomain (devicename|"portname")
To change the DNS search domains for a particular port or device:
$ sudo serversetup -setDNSDomain (devicename|"portname") domain1 [domain2]
[...]
To list the DNS search domains for a configuration:
$ sudo networksetup -getsearchdomains "configuration"
To set the DNS servers for a configuration:
$ sudo networksetup -setdnsservers "configuration" dns1 [dns2] [...]
To set the search domains for a configuration:
$ sudo networksetup -setsearchdomains "configuration" domain1 [domain2]
[...]
To validate a DNS server:
$ serversetup -verifyDNSServer server1 [server2] [...]
To validate DNS search domains:
$ serversetup -verifyDNSDomain domain1 [domain2] [...]
LL2354.book Page 41 Monday, October 20, 2003 9:47 AM