Posted on 08-14-2014 01:12 PM
We use OpenDNS Umbrella client for web filtering on some student machines. Brief background info is that we have 2 DNS servers that are pushed out via DHCP (the DNS servers are the IP of the OpenDNS HA servers that allow web access). I've found a few students manually adding DNS servers like 8.8.8.8 etc to avoid using these pushed DNS servers. Looking for a way to lock the DNS tab of any service in Network preferences and then if I can get that to work, clear out any manual entries that may have been added. Locking the Network Preferences pane will probably not be an option, I'm hoping to go a little deeper.
Posted on 08-14-2014 11:12 PM
To clear all manually entered search domain entries:
#!/bin/bash
declare -x SearchDomains="empty"
OLDIFS="$IFS"
IFS=$'
'
declare -x nserviceslist=( $(/usr/sbin/networksetup -listallnetworkservices | grep -Ei '(Ethernet|Wi-Fi|AirPort|Bridge)') )
IFS="$OLDIFS"
tLen=${#nserviceslist[@]}
echo "Network Services List:"
for (( i=0; i<${tLen}; i++ ));
do
/usr/sbin/networksetup -setsearchdomains "${nserviceslist[$i]}" "$SearchDomains"
/bin/echo "${nserviceslist[$i]} is now configured with $SearchDomains as DNS Search Domain."
done
exit 0
Posted on 08-15-2014 02:02 AM
Thx @Kumarasinghe, I'll play with this today or Monday
Posted on 09-23-2014 08:49 AM
@tommyday Here is the script I use to basically just remove the DNS view from inside the preference pane:
#!/bin/sh
# Greys out the Change Password button
rm /System/Library/PreferencePanes/Accounts.prefpane/Contents/Resources/en.lproj/ChangePasswordController.nib
# Remove DNS view
rm /System/Library/PreferencePanes/Network.prefPane/Contents/Resources/en.lproj/ANPAdvancedDNSView.nib
# Remove Proxy view
rm /System/Library/PreferencePanes/Network.prefPane/Contents/Resources/en.lproj/ANPAdvancedProxyView.nib
# Remove WINS view
rm /System/Library/PreferencePanes/Network.prefPane/Contents/Resources/en.lproj/ANPAdvancedWINSView.nib
Posted on 03-02-2023 11:27 AM
anyone have any more up-to-date recommendations for this request?