This discussion is locked
-
All replies
-
Helpful answers
-
Feb 23, 2006 3:19 PM in response to macsenseby Templeton Peck,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.
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. -
Feb 23, 2006 3:19 PM in response to macsenseby varjak paw,Send:
networksetup -setdnsservers <networkservice> <dns1> [dns2] [...]
as root. Specify "Empty" for <dns1> to clear all DNS entries.
---------
To see more commands like this, go to Terminal and enter
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/netw orksetup -help
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/syst emsetup -help
or from within the Remote Desktop Admin in the Send Unix Command window type:
networksetup -help
systemsetup -help -
Feb 23, 2006 4:06 PM in response to varjak pawby macsense,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 <dns1> with <Empty> or <"> or something else. I tried the first two and they failed. -
Feb 24, 2006 8:23 AM in response to macsenseby varjak paw,Sorry I apparently wasn't clear, but I meant it exactly as I put it; in quotation marks, sans the brackets.
So if you're using the built-in Ethernet port, the syntax would be (exactly as shown):
networksetup -setdnsservers "Built-in Ethernet" "Empty" -
Feb 24, 2006 8:57 AM in response to varjak pawby macsense,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.
Thanks! -
Feb 24, 2006 10:09 AM in response to macsenseby Templeton Peck,The <networkservice> parameter would be the interface that you're wanting to change, such as "Built-in Ethernet" or "Airport." -
Feb 24, 2006 10:25 AM in response to macsenseby varjak paw,And <dns1>, <dns2> etc are the IP addresses of your domain name servers, should you wish to specific any in the future.
Regards. -
Mar 1, 2006 10:34 AM in response to varjak pawby macsense,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?
Thanks again. -
Mar 1, 2006 11:34 AM in response to macsenseby varjak paw,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? -
Mar 1, 2006 2:11 PM in response to varjak pawby macsense,That makes sense. I tried...
networksetup -setdnsservers "Built-in Ethernet" "Empty"
sleep 20
sudo shutdown -r now
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.... -
Mar 23, 2006 6:30 AM in response to macsenseby Beth Ernst,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?
Thanks for any help.
Beth -
Mar 23, 2006 8:24 AM in response to Beth Ernstby varjak paw,Would I use the same commands in this post and replace dns1 with our DNS' new IP address?
Correct.
Will this distrupt the users access to the network when I do so?
Probably not, but it would probably be a good idea to do this when people aren't using their computers just in case something does go wrong. -
-