I needed to use particular dns and would change them quickly (with a click)
here is how i did it:
First, here command for make modification by terminal:
sudo networksetup -setdnsservers <networkservice> DNS1, DNS2, DNS3
How to obtain a list of your network services:
networksetup -listallnetworkservices
you will obtain outcome like below:
In my case i have to change Wi-fi dns, so (as example i’ve used Google dns 8.8.8.8 and 8.8.8.4 ), opening terminal and running the following command , DNS will be changed:
“sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.8.4”
But how to run it with a click ? using Apple script : open it and insert the following commands :
First row executes the command described above , while second line brings up a message that tells us that the command was executed (clearly is optional) .
After that save as application and work is ended; a click will be enough to change your dns
Here is the result after clicking (you will be prompted for the root password )
Looking Dns section we can see that they have been modified
Language:
-
Recent Posts
Categories
News BBC
- Lula: Brazil's ex-president cleared by Supreme Court
- Bata explosion: Equatorial Guinea death toll rises to 98
- New US guidance says fully vaccinated people can meet without masks
- Malala Yousafzai signs production deal with Apple TV+
- Samuel Paty: French schoolgirl admits lying about murdered teacher
- Google HR 'suggested medical leave' for racism victims
Recent Comments
Current Distro
My football team
Archives
- February 2021
- December 2020
- August 2020
- June 2018
- May 2018
- January 2018
- August 2017
- April 2017
- September 2016
- June 2016
- November 2015
- June 2015
- December 2014
- September 2014
- August 2014
- July 2014
- November 2013
- September 2013
- May 2013
- January 2013
- December 2012
- October 2012
- September 2012
- August 2012
- March 2012
- January 2012
- July 2011
- May 2011
- April 2011
- February 2011
- May 2009
- November 2008
- October 2007