Skip to main content
Jamf Nation, hosted by Jamf, is the largest Apple IT management community in the world. Dialog with your fellow IT professionals, gain insight about Apple device deployments, share best practices and bounce ideas off each other. Join the conversation.
Posted: by jake
Product: Mac OS X
Downloads: 1292


sudo <mountPoint> <computerName> <currentUsername> <networkInterface> <dnsServer>

If the $networkInterface parameter is specified (parameter 4), this is the Netowrk Interface for
which DNS server that will be set. The expected values for the $networkInterface parameter can
be found by running the command:

networksetup -listallnetworkservices

If the $dnsServer parameter is specified (parameter 5), this is the DNS server that will be set.

If no parameter is specified for parameters 4 and 5, the hardcoded value in the script will be used.


This script will set a DNS Server in the network settings for whichever network interface has been specified.


Generating Preview...