Created
December 8, 2018 06:58
-
-
Save jacobSingh/3627298b9341837141d82fd7b9f1ed78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
DNS_SERVER="1.1.1.1" | |
networksetup -getdnsservers Wi-Fi | grep "$DNS_SERVER" > /dev/null | |
if [ $? != 0 ]; then | |
networksetup -setdnsservers Wi-Fi "$DNS_SERVER" | |
echo "Added 3rd party DNS $DNS_SERVER" | |
else | |
networksetup -setdnsservers Wi-Fi Empty | |
echo "Removed 3rd party DNS " | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment