#!/bin/sh # Haven — revert DNS changes on this Mac. Run with sudo. networksetup -listallnetworkservices | tail -n +2 | while IFS= read -r service; do case "$service" in \**) continue ;; esac echo "Resetting: $service" networksetup -setdnsservers "$service" "Empty" done # Remove the SafeSearch pins, leaving any other hosts entries untouched. TMP=$(mktemp) sed '/# BEGIN HAVEN SAFE SEARCH/,/# END HAVEN SAFE SEARCH/d' /etc/hosts > "$TMP" cat "$TMP" > /etc/hosts rm -f "$TMP" dscacheutil -flushcache 2>/dev/null killall -HUP mDNSResponder 2>/dev/null echo 'Search and video safety locks removed.' echo 'Done. This Mac now uses the network default DNS again.'