How can I set my DNS settings using the command-prompt or bat file at windows 8
I tried this:
netsh interface ip set dns name="Local Area Connection" source=static addr=none
but not worked.
Double-click on the icon for the internet connection you are using and then click 'Properties' Click on 'Internet Protocol Version 4 (TCP/IPv4)', then 'Properties' Select the option 'Use the following DNS server addresses' Enter the new DNS address, then click 'OK' to apply the new settings.
At the command prompt, type ipconfig /displaydns and press Enter to see that the entry is in your DNS cache. Type ping university and press Enter.
To make changes, click the Edit button. Select Manual from the dropdown menu when the “Edit network DNS settings” dialog comes up. Next, turn on IPv4 and type in the preferred and alternate DNS provider's details. For example, to use Google's public DNS, type 8.8.
First, the network name is likely "Ethernet", not "Local Area Connection". To find out the name you can do this:
netsh interface show interface
Which will show the name under the "Interface Name" column (shown here in bold):
Admin State State Type Interface Name ------------------------------------------------------------------------- Enabled Connected Dedicated Ethernet
Now you can change the primary dns (index=1), assuming that your interface is static (not using dhcp):
netsh interface ipv4 add dnsserver "Ethernet" address=192.168.x.x index=1
2018 Update - The command will work with either dnsserver
(singular) or dnsservers
(plural). The following example uses the latter and is valid as well:
netsh interface ipv4 add dnsservers "Ethernet" address=192.168.x.x index=1
To change DNS to automatic via command, you can run the following command:
netsh interface ip set dns "Local Area Connection" dhcp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With