Tag Archives: open dns

Automatically change Mac OS X DNS settings using bash

Saved as an executable file (by running “chmod 755” in Terminal), following code changes the DNS servers used by the selected network adaptor to OpenDNS servers. Modify the name of the adaptor “Ethernet Adaptor (en3)” to fit the active network adaptor you are using.


#!/bin/bash
networksetup -setdnsservers "Ethernet Adaptor (en3)" 208.67.222.222 208.67.220.220;
exit;