Skip to content

Instantly share code, notes, and snippets.

@gnthibault
Last active July 22, 2024 08:30
Show Gist options
  • Save gnthibault/8eccfd0ae78587ab62ff52dbda602d0a to your computer and use it in GitHub Desktop.
Save gnthibault/8eccfd0ae78587ab62ff52dbda602d0a to your computer and use it in GitHub Desktop.
DNS debugging on mac
#!/bin/bash
# From https://rakhesh.com/powershell/vpn-client-over-riding-dns-on-macos/
# You can debug dns issues with: dns-sd -G v4v6 host.example.com
# You can put this file in home then crontab:
# @hourly /Users/yourname/fix_dns.sh
sudo scutil << EOF
get State:/Network/Service/gpd.pan/DNS
d.remove SearchDomains
d.remove ServerAddress
d.add ServerAddresses * 192.168.17.1 2001:8f8:172d:3ca9::1
set State:/Network/Service/gpd.pan/DNS
exit
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment