The common way to set IP addresses for primary and secondary DNS servers in Windows is through Network and Sharing Center > Change Adapter Settings followed by selecting “Properties” of the specific adapter and then configuring IP settings.
All of the above can be done through just two lines from Windows command prompt. Suppose DNS server IPs to be set are 126.96.36.199 and 188.8.131.52 (these are OpenDNS IPs, here is the related post on that), then to do this :
Open Windows command prompt as and administrator (Right click and select “Run as administrator” for Accessories > Command prompt).
then enter the following :
This will set the IP address of primary DNS server as 184.108.40.206.
To set the secondary DNS IP :
So now, the primary and secondary DNS servers will be having IP addresses : 220.127.116.11 and 18.104.22.168.
Same can be verified through the adapter properties :
Short and sweet. 🙂