Configure windows (and MAC) to point to a specific DNS server for Specific domain
- Get link
- X
- Other Apps
I have probably searched off an on for this solution for about 10 years at this point, and always found some other way to work around the issue.
Well today I was searching for some other DNS settings and found this:
https://docs.microsoft.com/en-us/powershell/module/dnsclient/add-dnsclientnrptrule?view=windowsserver2022-ps
And it actually works!
So here is my example:
Add-DnsClientNrptRule -Namespace ".universe.lab" -NameServers "10.10.1.1"
Ran this as an admin
I want any thing going to 'universe.lab' (dont forget to pre-pend the "." ) to go to 10.10.1.1
And then you can check what you have configured
PS C:\WINDOWS\system32> get-DnsClientNrptRule
Name : {2942DF55-16A3-4EED-B71B-7274B18F4FED}
Version : 2
Namespace : {.universe.lab}
IPsecCARestriction :
DirectAccessDnsServers :
DirectAccessEnabled : False
DirectAccessProxyType :
DirectAccessProxyName :
DirectAccessQueryIPsecEncryption :
DirectAccessQueryIPsecRequired :
NameServers : 10.10.1.1
DnsSecEnabled : False
DnsSecQueryIPsecEncryption :
DnsSecQueryIPsecRequired :
DnsSecValidationRequired :
NameEncoding : Disable
DisplayName :
Comment :
Fantastic right?!
And just to add in , the command for macOS is below just change the 10.10.1.1 to your DNS server and change universe.lab to your specific domain.
sudo cat 'nameserver 10.10.1.1' > /etc/resolver/universe.lab
- Get link
- X
- Other Apps
Comments
Post a Comment