Created
November 6, 2023 19:07
-
-
Save animatedlew/11c0743c7da69c8e1a3a448d523b3453 to your computer and use it in GitHub Desktop.
AppleScript that points DNS settings to Google.
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
set var to "Do you want to point your DNS to Google servers?" | |
set question to display dialog var buttons {"Update DNS", "Quit"} giving up after 5 | |
set answer to button returned of question | |
if answer is "Update DNS" then | |
do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4" with administrator privileges | |
delay 3 | |
do shell script "dscacheutil -flushcache" with administrator privileges | |
display dialog "Your DNS now points to Google servers." buttons {"Bye!"} | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment