Skip to content

Instantly share code, notes, and snippets.

@tujlaky
Last active November 14, 2024 14:29
Show Gist options
  • Save tujlaky/067efdcfb74042b65a4cf5bfd90a3d6d to your computer and use it in GitHub Desktop.
Save tujlaky/067efdcfb74042b65a4cf5bfd90a3d6d to your computer and use it in GitHub Desktop.
Fix DNS after VPN (OpenVPN or Tunnelblick) disconnect issues
#!/bin/sh
# https://github.com/Tunnelblick/Tunnelblick/issues/789
echo-active-dns() {
echo Current DNS server: `scutil --dns | grep 'nameserver' | uniq | awk '{print \$3}'`
}
alias restart-dns="networksetup -setdnsservers Wi-Fi empty; echo-active-dns;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment