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.
So if you check the Ethernet connection you'd send the command:
networksetup -getdnsservers Built-in\ Ethernet
For more options, send the Unix command
networksetup -help to the client computer.
Thanks for this help. I'm getting a syntax error when running it however. I think the problem is with the "Empty" command. Do you mean to replace with or <"> or something else. I tried the first two and they failed.
Thank you Dave. You have been very helpful. This solution works perfectly now. Where do I find out more information about what goes in these parameters? I also couldn't figure out what went into the <networkservice> parameter.
After the unix command to remove the DNS servers I wish to reboot the workstations. Here is what I'm using now.
networksetup -setdnsservers "Built-in Ethernet" "Empty"
sudo shutdown -r now
This appears to do the trick and restart the workstation however in ARD the task keeps showing that it is still processing long after the machine has rebooted. Is there a trick to get the unix command to quit after restarting?
It may be that the restart is happening before the ARD client has a chance to report that the command has succeeded. How long does the change take to clear if you don't immediately restart the system?
which causes the system to pause 20 seconds before restarting and it still does it. Even running the sudo shutdown -r now by itself causes the problem. So even sending a restart command may not allow enough time for ARD to report back before the machine restarts. Hmmmm....
Our network administrator is getting ready to change the IP address of our DNS server. This means I have over 30 Macs that will be needing changes to their DNS settings. Since each machine is setup with limited access to the system prefs, that means I have to go to each machine and log in as the admin user to make this change. In the interest of saving time, is this something I can do with Remote Desktop and how? Would I use the same commands in this post and replace dns1 with our DNS' new IP address? Will this distrupt the users access to the network when I do so?