Hi Chris
If you enter /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup without arguments you get the list with the options.
Normally I would do this:
networksetup -setdnsservers "Built-in Ethernet" a.b.c.d
to set a manual IP, but if I want to use DHCP then what I want is to /clear/ the address listed. But, if I send either no IP addresses, a pair of single quotes or a pair of double quotes, networksetup complains. Does anyone know how to do what I'm referring to? To accomplish the functionality I want through the OS X GUI, you just launch Network settings from System Preferences and, so long as you're using DHCP, clear whatever manual IP addresses are defined for DNS servers. OS X knows to automagically use the DHCP-supplied ones if you do that.
I think the following is what you are looking for:
Usage: networksetup -setdhcp <networkservice> [clientid]
Set the <networkservice> TCP/IP configuration to DHCP. You can set the
DHCP client id to the optional [clientid]. Specify "Empty" for [clientid]
to clear the DHCP client id.
Usage: networksetup -setdnsservers <networkservice> <dns1> [dns2] [...]
Set the <networkservice> DNS servers to <dns1> [dns2] [...]. Any number of dns servers can be
specified. Specify "Empty" for <dns1> to clear all DSN entries.
Thanks Gregor! The "empty" command is exactly what I needed.