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