I needed a quick way to set Iranian DNS servers like Shecan and 403 for my own use, so I wrote this simple script. Just provide the DNS name and connection name, and you're all set!
Since it was useful to me, I decided to share it.
Have a new DNS to add? Make a PR ✨
git clone https://github.com/pooya-hajjar/ez-DNS-setter.git ez-dns-setter
sudo cp ./ez-dns-setter/dns-setter /usr/local/bin/
sudo rm -rf ./ez-dns-setter
sudo chmod +x /usr/local/bin/dns-setterNow you can run the dns-setter script from anywhere on your system:
dns-setter <alias> <connection_name>- none (to reset DNS to system automatic)
- cloudflare
- shecan
- 403
- radar
- electro
Run this command to list your network connections:
nmcli connection showPick the connection NAME you want from the list.