DNS
Internal names do not resolve on a VPN
macOS can send queries for one domain to one DNS server and other queries to another. VPNs use this split DNS for internal names.
Symptoms
- Internal names such as
intranet.corp.examplefail, but public sites work. - An internal IP address works, but its name does not.
digornslookupfail, but the browser works, or the opposite.
Likely causes
- The VPN does not add a resolver for the domain. The VPN must tell macOS which domains go to its DNS servers.
- A test tool that skips the macOS rules.
diguses the servers in/etc/resolv.conf, not the per-domain resolvers that apps use. - Manual DNS servers. DNS servers set by hand on Wi-Fi do not know internal names.
- A short name without a search domain. A short name such as
intranetneeds a search domain to become a full name.
How to check
Connect the VPN. Show all resolvers. Look for a resolver with a
domainline for your company domain.scutil --dnsLook up the name through the macOS resolver, not through
dig.dscacheutil -q host -a name intranet.corp.exampleShow the search domains of the service.
networksetup -getsearchdomains Wi-Fi
How to fix it
Ask your administrator which domain and DNS server the VPN should use.
Make the folder for per-domain resolvers, if it does not exist.
sudo mkdir -p /etc/resolverNeeds an administrator password.
Make a file named after the domain. Put one
nameserverline in it for each server.sudo nano /etc/resolver/corp.exampleNeeds an administrator password.
Type the address of the internal DNS server on one line.
nameserver 10.0.0.53Save the file. Run
scutil --dnsand look for the new domain.Use full names, or add the search domain in System Settings > Network > the service > Details > DNS.
Remove the file when you no longer need it.
sudo rm /etc/resolver/corp.exampleNeeds an administrator password.
With Kilobat
For a private name,
whysays which VPN resolver it went to and if that resolver answers.kilobat why intranet.corp.example
Questions
Why does dig fail when the browser works?
dig asks the servers in /etc/resolv.conf. The browser uses the macOS resolver, which also uses the per-domain resolvers.
Can I edit /etc/resolv.conf?
No. The resolver man page says that macOS maintains this file automatically. Use Network settings or /etc/resolver.
Sources
- resolver(5), man page installed with macOS 27.2
- scutil(8), man page installed with macOS 27.2
- dig(1), man page installed with macOS 27.2
- Apple Support: Change DNS settings on Mac
Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.