Change Networksettings on MacOS X on the commandline

by Wolfram Saringer  (2011-09-22)
last change: 2011-09-22


First determine the installed services / interfaces:
# networksetup -listallnetworkservices

Read the current configuration for a service (name as listed in the output above):
# networksetup -getinfo Ethernet

Change e.g. the DNS server:
# networksetup -setdnsservers "Ethernet" 8.8.8.8



all articles represent the sole opinion of their respective author. all content comes without any warranty for correctnes, despite due diligence.