Posted on 02-26-2021 10:47 AM
Hi, don't know if anyone can help, but we are experiencing an issue where all our students are having their DNS server info changed to a loopback 127.0.0.1 and causing them not to be able to connect to the internet. We have given them instructions to change this, but I need to create a script to push out to all student laptops to be able to do this so we can stop being inundated with calls and tickets. My knowledge of implementing scripts is elementary with Jamf. Anyone there that can help with a script and how to implement?
Posted on 02-26-2021 10:59 AM
This script will reset DNS back to default settings. Do you have any network config profiles setup or scripts with a place holder DNS setting? Just things to check.
#!/bin/bash
NetworkServices=`networksetup -listallnetworkservices`
if [[ $NetworkServices =~ "Wi-Fi" ]];then
networksetup -setdnsservers Wi-Fi empty
echo "Reset DNS Servers for Wi-Fi"
fi
if [[ $NetworkServices =~ "Ethernet" ]];then
serviceName=`networksetup -listallnetworkservices | grep "Ethernet" -m 1`
networksetup -setdnsservers "$serviceName" empty
echo "Reset DNS Servers for $serviceName"
fi
if [[ $NetworkServices =~ "LAN" ]];then
serviceName=`networksetup -listallnetworkservices | grep "LAN" -m 1`
networksetup -setdnsservers "$serviceName" empty
echo "Reset DNS Servers for $serviceName"
fi
Posted on 02-26-2021 11:26 AM
No we don't. Thank you for this script. I'll give it a shot.
Posted on 02-27-2021 11:06 AM
We just had this occur, and cisco made an update to OpenDNS which rendered machines wifi brain dead.
A now cersion came out as well. Which still requires one to create a new location.
Once they do that i can see them again, but need this script to get rid of the loopback. Thanks for that.
Posted on 01-13-2022 07:03 AM
Hey @rhooper just wondering how you're. handling using this script for Umbrella issues. We are running into the same thing for the past few months.