Skip to content

Amirali-Bagheri/mac-dns-changer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MacOS DNS Changer (Supported Iranian DNS)

This shell script enables setting DNS servers for WiFi (WLAN interface) on MacOS devices. It provides options for both Iranian and global DNS servers.

Iranian DNS Servers:

  1. Shecan
  2. Electro
  3. Radar Game
  4. DNS Pro
  5. Begzar
  6. 403.online
  7. Server.ir
  8. Host Iran
  9. Shatel
  10. Asia Tech
  11. Pars Online
  12. Pishgaman
  13. Resaneh Pardaz

Global DNS Servers:

  1. Cloudflare
  2. Open DNS
  3. Google
  4. Pihole
  5. UncensoredDNS
  6. CZ_NIC
  7. Level 3
  8. Comodo Secure
  9. Control D
  10. Alternate
  11. Verisign
  12. Open Nic
  13. Yandex
  14. DNS Watch
  15. Oracle Dyn
  16. Freenom World
  17. Flash Start
  18. Quad9
  19. Some DNS
  20. Neustar DNS
  21. Sprintlink
  22. NTT
  23. CleanBrowsing
  24. AdGuard
  25. Norton ConnectSafe
  26. SafeDNS
  27. SmartViper
  28. UncensoredDNS
  29. puntCAT
  30. CNNIC SDNS
  31. AliDNS
  32. DNSPod
  33. OneDNS
  34. GreenTeamDNS
  35. OpenNIC
  36. FreeDNS
  37. Hurricane Electric
  38. Baidu
  39. 114DNS

Screenshots:

Usage:

Download and Run Script from GitHub Repository

You can easily download and execute the dns.sh script from the GitHub repository using either curl or wget.

Using curl:

curl -O https://raw.githubusercontent.com/Amirali-Bagheri/mac-dns-changer/main/dns.sh && chmod +x dns.sh && ./dns.sh
  • curl -O https://raw.githubusercontent.com/Amirali-Bagheri/mac-dns-changer/main/dns.sh: Downloads the dns.sh script from the specified URL and saves it with the same name in the current directory.
  • chmod +x dns.sh: Changes the permissions of the downloaded script to make it executable.
  • ./dns.sh: Executes the downloaded script.

Using wget:

wget https://raw.githubusercontent.com/Amirali-Bagheri/mac-dns-changer/main/dns.sh && chmod +x dns.sh && ./dns.sh
  • wget https://raw.githubusercontent.com/Amirali-Bagheri/mac-dns-changer/main/dns.sh: Downloads the dns.sh script from the specified URL.
  • chmod +x dns.sh: Changes the permissions of the downloaded script to make it executable.
  • ./dns.sh: Executes the downloaded script.

Note: Make sure to review the script content and its purpose before executing it on your system.

Running the Script with Options

You can directly run the script with an option. For example, to automatically find the best DNS server for 403 Unlock, use:

sudo sh ./dns.sh 1

Automate DNS Changes with Cron

To automate the DNS changes and find the best server every hour, you can set up a cron job. Here's how you can do it:

  1. Open your crontab file for editing:
sudo crontab -e
  1. Add the following line to schedule the dns.sh script to run every hour:
0 * * * * /path/to/dns.sh 1

Replace /path/to/dns.sh with the actual path to your dns.sh script.

This cron job will run the script at the beginning of every hour, automatically finding and setting the best DNS server.

Tested on Mac OS 13+ running on Macbook Pro and iMac.

About

MacOS DNS Changer (Supported Iranian DNS)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages