Last active
December 9, 2020 08:53
-
-
Save adrianriobo/8776b8642b968574a03dcb757533dd34 to your computer and use it in GitHub Desktop.
Powershell for DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check rules | |
Get-DnsClientNrptRule | |
#Set metric to manage interface precedence order | |
Set-NetIPInterface -InterfaceIndex 17 -InterfaceMetric 15 | |
# Check / Set DNS address | |
Get-DnsClientServerAddress | |
Set-DnsClientServerAddress -InterfaceIndex 17 -ServerAddresses ("172.17.167.38") | |
Set-DnsClientServerAddress -InterfaceIndex 17 -ResetServerAddresses | |
# Manage DnsClientNrptRule | |
Get-DnsClientNrptRule | ? {$_.namespace -like '*.testing'} | Remove-DnsClientNrptRule -Force | |
Add-DnsClientNrptRule -Namespace ".subdomain.domain" -NameServers "192.168.185.201" | |
Add-DnsClientNrptRule -Namespace ".subdomain2.domain" -NameServers "192.168.185.201" | |
# Flush DNS | |
ipconfig /flushdns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment