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 22.214.171.124 and 126.96.36.199 (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 188.8.131.52.
To set the secondary DNS IP :
So now, the primary and secondary DNS servers will be having IP addresses : 184.108.40.206 and 220.127.116.11.
Same can be verified through the adapter properties :
Short and sweet.