Skip to content

Instantly share code, notes, and snippets.

@alecrem
Created May 16, 2013 14:13
Show Gist options
  • Save alecrem/5592007 to your computer and use it in GitHub Desktop.
Save alecrem/5592007 to your computer and use it in GitHub Desktop.
Swap DNS servers (OSX)
networksetup -getdnsservers Wi-Fi
networksetup -getdnsservers Wi-Fi | while read n
do
if [ "$n" = "There aren't any DNS Servers set on Wi-Fi." ] ; then
echo "none -> google"
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4
else
echo "google -> none"
sudo networksetup -setdnsservers Wi-Fi Empty
fi
break
done
networksetup -getdnsservers Wi-Fi
@sebke
Copy link

sebke commented May 16, 2013

Muy buena idea!
Lo tenes cronado o lo ejecutas cuando no navegas?

@alecrem
Copy link
Author

alecrem commented May 16, 2013

@sebke Por ahora, una copia llamada changedns.command añadida al Dock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment