Hi everyone!
How do I add multiple DNS Servers into a Windows Server 2019 core using netsh?
Thanks.
Hi everyone!
How do I add multiple DNS Servers into a Windows Server 2019 core using netsh?
Thanks.
Hi,
I did a test in my lab and found that the command netsh interface ipv4 add dnsserver name=Ethernet address=192.168.0.101 index=1 can be run successfully in my Windows Server 2019 core.
Here is my test result for your reference:
My systeminfo result:




Here is an article for your reference:
Manually install a Server Core installation
Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
If you still cannot configure the DNS server on your server core, please help to provide related screenshots for further troubleshooting.
Best Regards,
Sunny
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
You can find the interface name
netsh interface show interface
then add the DNS addresses
netsh interface ipv4 add dnsservers "Ethernet" address=192.168.x.x
--please don't forget to upvote and Accept as answer if the reply is helpful--
I guess I was not clear enough.
I need to add two DNS Servers into NIC TCP/IP settings, 10.168.1.4 and 10.168.1.5, but after I do it only last one shows in the ipconfig /all command output. It appears that the second address overwrites the primary one. :-(
Thanks.
You can do
netsh interface ipv4 add dnsservers "Ethernet" address=10.168.1.4 index=1
netsh interface ipv4 add dnsservers "Ethernet" address=10.168.1.5 index=2
--please don't forget to upvote and Accept as answer if the reply is helpful--
You may need to delete them first
netsh interface ip delete dns "Ethernet" [old DNS ip address]
--please don't forget to upvote and Accept as answer if the reply is helpful--
Another option is to use PowerShell. Use Get-NetAdapter to find the index
https://devblogs.microsoft.com/scripting/powertip-use-powershell-to-set-primary-and-secondary-dns-server-addresses/
--please don't forget to upvote and Accept as answer if the reply is helpful--
Just checking if there's any progress or updates?
--please don't forget to upvote and Accept as answer if the reply is helpful--
Thanks all!
I was using "netsh interface ip" and not "netsh interface ipv4" commands.
MS should remove those old commands, I guess.
Thanks again. :-)
Why did you not mark my answer??? I gave you the correct solution much sooner. Please fix that.
I want to add the third and fourth DNS server using netsh command and I am getting that the "index" is not a valid argument for this command. (Windows 2016)
13 people are following this question.