Override DNS order when conencted to a VPN?

2

I'm having some issues with DNS when I connect to my VPN from my Mac.

When not connected, scutil --dns (the DNS lookup table) returns:

resolver #1
  nameserver[0] : 10.0.1.1
  flags    : Request A records
  reach    : Reachable,Directly Reachable Address

Perfect. 10.0.1.1 is my wifi router.

However, if I connect to my VPN:

resolver #1
  nameserver[0] : 10.8.1.23
  flags    : Request A records
  reach    : Reachable,Transient Connection
  order    : 100000

resolver #2
  nameserver[0] : 10.0.1.1
  flags    : Request A records
  reach    : Reachable,Directly Reachable Address
  order    : 200000

10.8.1.23 is the DNS server on the network to which I am connecting over VPN. However, notice the order parameter: even though I explicitly set my local DNS as first priority, the VPN seems to be overriding this by putting its own DNS first.

This is particularly annoying, as the VPN DNS is resolving differently than my local DNS (notably, it is redirecting www.google.com to nosslsearch.google.com).

Is there a way I can override this DNS order, and force my own DNS to always come first no matter what? I still need the VPN DNS in place, however, for when I need to connect to servers within the VPN.

baum

Posted 2015-01-09T20:43:19.863

Reputation: 255

maybe add nosslsearch.google to your hosts file and resolve it to 216.58.216.142 or another google IP. <- not 100% sure it will work, but it's worth a try. – Ben Plont – 2015-01-09T20:53:50.500

True, but that's on a per-host basis. I want all network requests to resolve first to my local DNS, then my VPN DNS. But the VPN DNS doesn't want it to be this way... – baum – 2015-01-09T20:55:43.960

No answers