Windows – Split-DNS on Windows

domain-name-systeminternal-dnssplit-dnsvpnwindows

I have an internal network in which all services are registered under a internal domain (e.g.: coolcorp.io).

When users connect to the VPN, I want them to be able to resolve the internal services in *.coolcorp.io, without having any other "public" name resolution going through our internal DNS server.

In macOS and Linux I can do that creating a custom resolver setting under /etc/resolver to that specific domain.

I'm not sure how can I do that on Windows. We don't have AD and the DNS is not supposed to be the default gateway for our VPN.

Best Answer

For background, lets look at how the DNS Stack works on Windows.

When a resolution for an FQDN needs to happen say a.contoso.com

  • If no match is found in the Cache or hosts file
  • The OS looks at the Name Resolution Policy Table, this is an interface agnostic list where you can specify the DNS Server IP Address or Proxy Server to use for the Name or Suffix
  • If no match in the NRPT Table queries are sent on the interfaces and the response from the most preferred interface is selected (Lan > VPN > Wi-Fi > Cellular)

Now for your particular case the best thing to do is to add an NRPT entry for *.coolcorp.io and the Corporate DNS Servers. On Windows 10, this can be part of the Windows VPN Profile via the DomainNameInformationList property in the VPNv2 CSP for MDM's https://docs.microsoft.com/en-us/windows/client-management/mdm/vpnv2-csp. The NRPT Policies can also be added via the Add-DnsClientNrptRule powershell commandlet. This will make sure that all resolutions for *.coolcorp.io goto the VPN Server. Next, in your VPN profile itself you now need not give a DNS Server Address or a DNS Suffix.