Created
August 26, 2025 19:34
-
-
Save Hritik14/9791513b9715e62b12c511ef89632590 to your computer and use it in GitHub Desktop.
Scoped resolver for mac in case your corp vpn is unable to set dns correctly (happens on pritunl on mac)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOMAIN="corp.net" | |
CORP_DNS="1.2.3.4" | |
FILE="/etc/resolver/$DOMAIN" | |
echo "Setting scoped resolver for $DOMAIN" | |
mkdir -p /etc/resolver | |
{ echo "search_order 1" ; echo "nameserver $CORP_DNS"; } >"$FILE" | |
/usr/bin/dscacheutil -flushcache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment