Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mac VPN connections don't resolve DNS properly

Good Morning,


Yet another mac - vpn issue.


I have configured both ends of the VPN (I am network admin for the domains into which I want to vpn). However, when I connect using the built in Mac client I am not getting proper resolution to the remote <domain>.local domains.


scutil --dns shows why:


scutil --dns

DNS configuration


resolver #1

domain : hsd1.fl.comcast.net.

search domain[0] : alison.local

search domain[1] : hsd1.fl.comcast.net

search domain[2] : fl.comcast.net

search domain[3] : comcast.net

nameserver[0] : 75.75.75.75

nameserver[1] : 75.75.76.76

nameserver[2] : 192.168.242.1

order : 200000


resolver #2

domain : alison.local

nameserver[0] : 192.168.1.6

nameserver[1] : 192.168.1.15

order : 100200


resolver #3

domain : local

options : mdns

timeout : 2

order : 300000


resolver #4

domain : 254.169.in-addr.arpa

options : mdns

timeout : 2

order : 300200


...


There under resolver #1 is the domain name for the vpn. It should be handled by resolver #2.


dig fairs no better, it is trying to resolve from a couple root servers as show here...


cat /etc/resolv.conf

#

# Mac OS X Notice

#

# This file is not used by the host name and address resolution

# or the DNS query routing mechanisms used by most processes on

# this Mac OS X system.

#

# This file is automatically generated.

#

nameserver 4.2.2.2

nameserver 8.8.8.8


These entries seem to be completely static and don't seem to update based on the domain I am connected to.


I have tried permission repairs on the off chance the the core processes were not able to access the conf files, but to no avail.


I have been prowling for a metric butt-load of hours now trying to figure this out and am stumped.


Any assistance would be appreicated, or more succinctly, "Help me Mr. (or Ms.) Wizard!)


Thank you

David

Posted on Nov 10, 2011 5:48 AM

Reply
Question marked as Best reply

Posted on Oct 30, 2017 8:01 AM

Ok so it turns out that it's a bug in macOS 10.11 all the way to 10.13


DNS resolution with "ping internalhostname" will work just fine but "host internalhostname" or "nslookup internalhostname" will fail.


This is because macOS appends the search domain from the split tunnel VPN to the first DNS resolver (the LAN/wifi one) and its DNS servers have no idea how to look up those internal VPN hostnames.


I have no idea however how come "ping internalhostname" resolution works or how come internal webpage browsing works.. Apple is still investigating but it looks like a bug on macOS so far.

11 replies
Question marked as Best reply

Oct 30, 2017 8:01 AM in response to Uncle Davy

Ok so it turns out that it's a bug in macOS 10.11 all the way to 10.13


DNS resolution with "ping internalhostname" will work just fine but "host internalhostname" or "nslookup internalhostname" will fail.


This is because macOS appends the search domain from the split tunnel VPN to the first DNS resolver (the LAN/wifi one) and its DNS servers have no idea how to look up those internal VPN hostnames.


I have no idea however how come "ping internalhostname" resolution works or how come internal webpage browsing works.. Apple is still investigating but it looks like a bug on macOS so far.

Nov 10, 2011 3:17 PM in response to Uncle Davy

Ah, so I resolved the /etc/resolv.conf piece of the puzzle. It appears that my manual edit of that file (at one point trying to resolve this issue) broke the sym link to /var/run/resolv.conf. Thanks to https://discussions.apple.com/thread/2770717?start=0&tstart=0 I was able to restore that link.


However, the core vpn issue remains.


Thanks again for any assistance.

Nov 12, 2011 8:41 AM in response to MrHoffman

Thanks for the reply, MrHoffman.


I am not sure how that relates to DNS not resolving properly once a VPN is established.


From what I can tell the Search Domain [0]: alison.local should not be being added to Resolver 1. This domain should be handled by Resolver 2 the correct one for the domain.


I just can't figure out why it is being added to Resolver 1...

Jan 14, 2013 10:58 AM in response to Uncle Davy

Having similar problem. Mac Mini Server at each end, .home is 10.7.x and .private is 10.8.2. When another Mountain Lion Mac in the .private net connects to the .home VPN suddenly it can not reach either of two IMAP mail servers in .private.


This is a relatively recent development in the past few months. If I kill mDNSResponder on the problem client Mac then things work as expected for about 30 minutes.


Conventional DNS via nslookup gives the expected answers.


scutil --dns is very similar to the original post in this thread but the first resolver #1 on mine does not list a domain, only search domains. Resolver #2 lists the remote home domain.


The problem appears to be the remote DNS is being asked to resolve private local names and when that fails Mail.app searches no more. No matter the IMAP servers are named .private.


On a lark I looked at System Preferences -> Sharing and saw host name was "clumsy" and instructed to use clumsy.local to connect from others. Wouldn't let me edit the .local but the Edit... button would let me define a "global dynamic hostname" of clumsy.private.


Mail.app now seems to be able to find the .private IMAP servers. And the remote .home servers.


Have asked elsewhere but I'd be interested in a Mac equivalent of nslookup that would do things the Mac way for diagnostics.

Jan 14, 2013 12:53 PM in response to Uncle Davy

Maybe I'm missing something but I think you're misunderstanding how the resolver works.


From what I can tell the Search Domain [0]: alison.local should not be being added to Resolver 1. This domain should be handled by Resolver 2 the correct one for the domain.


That's not how it works. DNS doesn't care about the hostname you're looking up to determine which resolver to use.


DNS queries the first resolver in the list and takes whatever answer that returns. If the server fails (doesn't reply, isn't available, etc.) then the second resolver in the list is used.


In this case your primary resolver (75.75.75.75) is being asked for an IP address in the alison.local domain. Since that public server has no idea about your .local domain it returns an unknown host reply, and that is what your system sees. It does not then proceed to the secondary, or, ultimately, tertiary server, to get a second or third opinion.


Your solution hinges on using the private domain server 192.168.242.1 as the first server in the list.

Jan 14, 2013 1:47 PM in response to Camelot

I don't see where one has control over the order of search domains returned by "scutil --dns".


In my case I have:


scutil --dns

DNS configuration


resolver #1

search domain[0] : home

search domain[1] : private

nameserver[0] : 192.168.123.100

nameserver[1] : 69.1.30.42

nameserver[2] : 69.1.30.43

if_index : 5 (en1)

reach : Reachable,Directly Reachable Address


resolver #2

domain : home

nameserver[0] : 10.0.0.7

if_index : 7 (ppp0)

reach : Reachable,Transient Connection

order : 100000


resolver #3

domain : local

options : mdns

timeout : 5

order : 300000


As seen from the machine at 192.168.123.22 (clumsy.private).


imap1.private is also the DNS server at 192.168.123.100.

imap2.home is 10.0.0.7 on the far end of VPN.


Until I changed hostname in System Preferences -> Sharing from clumsy (which was promoted to clumsy.local) to clumsy.private I could nslookup imap2.private but Mail.app could not reach it by name, only number when the VPN was up. Yet Mail.app could talk to imap2.home. Drop the VPN, restart Mail.app, and all was fine.

Mac VPN connections don't resolve DNS properly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.