Created
July 26, 2023 11:11
-
-
Save realamirhe/3d6c9e8e60fd49ddee259ceea1349c94 to your computer and use it in GitHub Desktop.
mac dns setter from terminal
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
| function dns { | |
| if [[ $1 == "shecan" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 178.22.122.100 185.51.200.2 | |
| echo "[Shecan] dns has been set accrodingly" | |
| elif [[ $1 == "radar" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 10.202.10.10 10.202.10.11 | |
| echo "[Radar game] dns has been set accrodingly" | |
| elif [[ $1 == "electro" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 78.157.42.100 78.157.42.101 | |
| echo "[Electro Team] dns has been set accrodingly" | |
| elif [[ $1 == "403" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 10.202.10.202 10.202.10.102 | |
| echo "[403.online] dns has been set accrodingly" | |
| elif [[ $1 == "asia" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 194.36.174.161 178.22.122.100 | |
| echo "[asiatech] dns has been set accrodingly" | |
| elif [[ $1 == "cloud" ]] | |
| then | |
| networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 | |
| echo "[Cloudflare] dns has been set accrodingly" | |
| else | |
| networksetup -setdnsservers Wi-Fi "empty" | |
| echo "dns has been removed." | |
| fi | |
| } |
Author
Author
Robust version of the following bash function
https://github.com/Amirali-Bagheri/mac-dns-changer/blob/main/dns.sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set:
Verify: