DNS IP address change via terminal?

in macOS edited January 2014
I have remote access (I use ssh) to a Mac OS X box that has an incorrect DNS configuration. If I was in front of the machine I would use:

System Preferences, Network, DNS Servers

Where in Mac OS X is this info held and how can I change it from a shell login?




  • Reply 1 of 2
    These can be changed with a text editor (e.g. vi) by CAREFULLY editing


    by changing existing entries. What I don't know is how activate the changes without at least opening and closing the preference panel or logout or reboot.
  • Reply 2 of 2
    Thanks very much, I was informed elsewhere that editing /etc/resolv.conf does the trick. Sure enough it worked, without a reboot or anything.
Sign In or Register to comment.