-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xDnsServerAddress does not allow clearing of primary/secondary DNS Address #211
Comments
When empty it should use the following cmdlet Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ResetServerAddresses |
Hi @andy1547 - thanks for raising this! I have battled with this problem for a while now and I've tried to sum up the problem in this issue: I think it actually requires a change to the PowerShell cmdlets to expose whether or not DHCP is enabled on the DNS Client itself - which is currently not visible at all the PowerShell. |
Hi @andy1547 - I've completed the changes for this and am just waiting for a review to merge into the Dev branch. But if you're up for it you could test my version here: Thanks! |
@PlagueHO |
Thanks @andy1547 - this change has now been merged into Dev. So you can try it on the dev branch now. |
Will test this week, thanks @PlagueHO |
Hi @andy1547 - did you get a chance to check this one? Did it work OK? If so, can we close this one? |
Sorry @PlagueHO been a busy free months! Managed to test this today and worked as expected.
The only thing thing I noticed is an empty array is not permitted to clear the DNS servers, ideally an empty array would clear but null would leave as is. Great work though, thanks! |
Hi @andy1547 - sorry I forgot to respond to this one. But actually, it does look like we should be able to accept an empty array for |
If anyone else has the same problem to detect if the dns servers are static or from dhcp: |
This functionality is available in DnsServerAddress. @PlagueHO - I believe this issue can be closed. |
Address has a ValidateNotNullOrEmpty attribute however it's a valid operation to clear it.
If using DHCP then the manual address would be set back to automatic (just like the GUI).
If using a static IP, then the manual addresses would be cleared.
The text was updated successfully, but these errors were encountered: