Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I need to use preferred and alternate DNS server addresses, and sometimes I need Windows to obtain it automatically. The common approach to switch between those addresses is:

  • Right click on Local Area Connection icon on the taskbar notification area
  • Select Status
  • Click on Properties
  • Select Internet Protocol (TCP/IP) and select Properties
  • Switch between Obtain DNS server address automatically and Use the following DNS server addresses.

Since I am switching them frequently, I need a faster and easier way to do this. Any recommendations?

share|improve this question
up vote 2 down vote accepted

You could use the netsh.exe command-line utility to achieve that. I found this page which provides some examples, including a couple to edit nameservers.

share|improve this answer

I use Net Profiles for this purpose. You can make predefined network profiles and easily switch between them at any time:

alt text


  • Save your network settings as profiles.
  • Automatically activate wireless profiles when specified wireless connections are detected. (XP only)
  • Change IP Address, Subnet Mask, Default Gateway, Primary and Secondary DNS Servers, WINS Server, and DHCP settings with the click of a button.
  • Specifiy different mapped drives for each profile.
  • Change your default printer based on which profile you're currently using.
  • Automatically change your profile via program shortcuts created with Net Profiles.
  • Change the default homepage for Internet Explorer, Firefox, and Opera.
  • Proxy settings for Internet Explorer, Firefox, and Opera.
  • Run a user-defined list of programs when a profile is activated.
  • Maintain seperate desktop wallper for each profile.
  • Change screen resolutions and color quality when profiles are activated.
  • Can be easily translated into other languages using the enclosed XML language file.

Net Profiles is free and open source.

share|improve this answer

You could set up a Powershell script to change the DNS settings as shown in this blog:

$strDNSServers = "", "",""

function Update-DNS
  $Nic = Get-WMIObject Win32_NetworkAdapter -comp $strComputer |where{$_.NetConnectionID -eq "Local Area Connection"}

  $Config   = Get-WMIObject Win32_NetworkAdapterConfiguration -comp $strComputer |where{$_.MACAddress -eq $Nic.MACAddress}

  write-host "The current DNS Search Order is:"

  $config.SetDNSServerSearchOrder($strDNSServers) | out-null
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.