Changing your local DNS Nameservers


Today we’ll go over how to change the DNS on your home computer, this has a few benefits:

  1. If your ISP caches you when you , this will bypass that
  2. If your ISP has one of those search redirection pages, this will disable that
  3. Your overall browsing experience can be faster, and more secure (results will vary between the below providers)
  4. DNS propagation can be bypassed by using a 3rd party DNS for your local PC or network

We’re going to use google’s dns for this guide, however you can use any of these public providers:

Screen Shot 2013-07-03 at 9.24.14 AM


To change DNS on Windows 7/8, there are two ways.

First, we’ll use the GUI.

  1. From the desktop, press the Windows Key on the keyboard plus R at the same time. This will open the run dialogue.

Screen Shot 2013-07-03 at 8.47.04 AM

  1. Type in “ncpa.cpl” without the quotations, and select okay.
  2. Locate the icon for “Local Area Connection” if you use an Ethernet (cable) connection, and “Wireless Network Connection” (Win7) or “Wi-Fi”
  3. Right click on the icon, and select “Properties” from the menu.
  4. In the properties window, in the box marked “This connection uses the following items:”, find “Internet Protocol Version 4 (TCP/IPv4)”and select it, so that it is highlighted, then click the Properties button below it.

Screen Shot 2013-07-03 at 8.46.58 AM

  1. In the box, go down to the second set of options, and select “Use the following DNS server addresses:”. Then add as the Preferred DNS Server and as the Alternate.

Screen Shot 2013-07-03 at 9.21.11 AM

  1. Select OK.

Or to do it via command line.

  1. Open An Elevated Command Prompt

Go to your start button, and in the window labeled “Search programs and files” at the bottom, type in “CMD”. At the top, you’ll see an icon labeled “cmd.exe”. Right click that, and select “Run as Administrator”.

  1. At the prompt, type in “netsh” (minus quotes) and hit enter. Your prompt will change to say “netsh>” to let you know you’re in the correct prompt.
  2. At the netsh prompt, type in “interface ip set dns “Local Area Connection” (OR “Wireless Network Connection” (Windows 7) or “Wi-Fi Connection” (Windows 8) static” and hit enter.

Screen Shot 2013-07-03 at 8.47.12 AM


For Macs, like PCs, there are two ways. We’ll start with the GUI approach.

  1. Go to the Apple Menu in the upper left corner and select “System Preferences”.

Screen Shot 2013-07-03 at 8.47.18 AM

  1. Select the “Network” preferences from the “Internet and Wireless” row.

Screen Shot 2013-07-03 at 8.47.25 AM

  1. Select the service you wish to change from the column on the left hand side. Choose “Ethernet” for LAN cable or “Airport” (10.5 and 10.6) / “Wi-Fi” (10.7+) for Wireless Connections.Mac 10.4: Select the “Configure” button at the bottom.
    Mac 10.5 and Above: Select the “Advanced” button in the lower right corner.
  2. Select the tab marked “DNS”
  3. Select any entries in the box on the left and click the minus button at the bottom.
  4. Once the box is empty, click the plus sign and type in and hit Enter.
  1. Click the plus sign again and type in and hit Enter.

Screen Shot 2013-07-03 at 8.47.44 AM

Now for command line (terminal).

  1. Open up terminal (from your applications folder).
  2. Run “networksetup listallnetworkservices” from the command line. You’ll receive a list like this.

Screen Shot 2013-07-03 at 8.47.51 AM

  1. Now you can configure DNS for the appropriate network interface. Again, I’ll use my Ethernet connection. To change the DNS servers use the following command:

(You can use,,, or, they’re all Google DNS).
You can set as many DNS servers as you want, as long as you put a space in between.
Screen Shot 2013-07-03 at 8.47.59 AM


On Linux the DNS servers the system uses for name resolution are defined in the file,

/etc/resolv.conf (Spelled just like that, with no e).

You can open it in your favorite text editor. Just remember to use sudo when calling it:

sudo nano /etc/resolv.conf

Then in the editor, add the following lines:

Screen Shot 2013-07-03 at 8.48.07 AM

Then just save the file and you’re good. No reboot necessary.

Posted under Programming/Coding | RSS 2.0

Leave a Reply

Your email address will not be published. Required fields are marked *