Created
May 16, 2013 14:13
-
-
Save alecrem/5592007 to your computer and use it in GitHub Desktop.
Swap DNS servers (OSX)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muy buena idea!
Lo tenes cronado o lo ejecutas cuando no navegas?