How to change a computer DNS address

What is a DNS?

dns addressA Domain Name Server (DNS) acts like a phonebook for internet addresses. It's a networked computer system with a massive database of internet domain names and their corresponding addresses, which is constantly kept up to date.

When you make a network request to a domain name (entering google.com in your web browser, for instance), your computer needs to know where on the internet that domain is located. It gets this information from the DNS. Your computer sends a request to the DNS containing the name of the domain, and the DNS responds with that domain's numeric IP address. Your computer then proceeds to connect to that address.

The process is referred to as domain name resolution: a domain name resolves to its corresponding address.

Your ISP usually provides its own default DNS for its customers, and the settings for this server are automatically configured via DHCP. But you don't have to use your ISP's DNS. There are many publicly available Domain Name Servers, and you may want to use one of them instead.

Alternate Domain Name Servers

Here is a selection of public Domain Servers, current as of February, 2016. There are two addresses listed for each: a primary, and a secondary which acts as a backup if the first address is temporarily unavailable.

DNS Provider Primary Address Secondary Address
Google Public DNS 8.8.8.8 8.8.4.4
OpenDNS 208.67.222.222 208.67.220.220
Verisign 64.6.64.6 64.6.65.6
DNS.WATCH 84.200.69.80 84.200.70.40
OpenNIC 50.116.23.211 192.99.240.129
Dyn 216.146.35.35 216.146.36.36
DNS Advantage 156.154.70.1 156.154.71.1
SafeDNS 195.46.39.39 195.46.39.40
Comodo Secure DNS 8.26.56.26 8.20.247.20
Norton ConnectSafe 199.85.126.10 199.85.127.10
GreenTeamDNS 81.218.119.11 209.88.198.133
SmartViper 208.76.50.50 208.76.51.51
AlternateDNS 198.101.242.72 23.253.163.53
Yandex.DNS 77.88.8.8 77.88.8.1

You may decide to use one of these, or perhaps you need to change your DNS to an address provided by your school or your employer's IT department. Make sure you know the address(es) of your new DNS before you proceed.

Configuring Your Operating System

The steps for changing your computer's DNS settings will depend on what operating system you are running. Use the links below to navigate to the section which applies to you.

Before making any changes to your DNS configuration, it is highly recommended that you write down your current DNS address information so that you can revert these changes if necessary.

Note: If you find that you are unable to change your DNS addresses, it could be that you do not have the proper permissions to do so. If you have problems, contact your system administrator or IT department for assistance.

The following are step-by-step instructions for changing the DNS settings on Windows, OS X, Linux, and BSD operating systems:

Windows 10

  1. Open Control Panel
  2. Click View network status and tasks
  3. Click Change adapter settings on the left portion of the Window.
  4. Double-click the icon for the Internet connection you're using.
  5. Click the Properties button.
  6. Click and highlight Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  7. If not already selected, select the Use the following DNS server addresses option.
  8. Enter the new DNS addresses and click OK and close out of all other windows.

Windows 8

  1. Access the Windows desktop screen.
  2. Press Ctrl + I on the keyboard to open the Settings menu and select the Control Panel option.
  3. Click the Network and Sharing Center icon.
  4. Click the Change adapter settings option in the left navigation pane.
  5. Double-click the icon for the Internet connection you are using that may be labeled "Ethernet" if using a wired Internet or network connection, or it may be labeled "Wi-Fi" if using a wireless Internet or network connection. If you have multiple connections, make sure not to select the one with the red X. In the Properties or Status window that opens, click the Properties button.
  6. Select the Internet Protocol Version 4 (TCP/IPv4) option in the list of items on the Properties window and click the Properties button.
  7. If not already selected, select the Use the following DNS server addresses option.
  8. Enter the new DNS addresses and click OK and close out of all other windows.

Windows 7

  1. Open Control Panel
  2. Click View network status and tasks
  3. Click Change adapter settings on the left portion of the Window.
  4. Double-click the icon for the Internet connection you're using. Often this will be labeled "Local Area Connection" or the name of your ISP. If you have multiple connections, make sure not to click the one with the red X.
  5. Click the Properties button.
  6. Click and highlight Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  7. If not already selected, select the Use the following DNS server addresses option.
  8. Enter the new DNS addresses and click OK and close out of all other windows.

Windows Vista

  1. Open Control Panel
  2. Click View network status and tasks
  3. Click View status for the network connection.
  4. Click Properties and Continue.
  5. Click and highlight Internet Protocol Version 4 (TCP/IPv4) and click Properties.
  6. If not already selected, select the Use the following DNS server addresses option.
  7. Enter the new DNS addresses and click OK and close out of all other windows.

Windows XP

  1. Open Control Panel
  2. In the Control Panel window double-click the Network Connections icon.
  3. Double-click the icon for the Internet connection you're using. Often this will be labeled "Local Area Connection" or the name of your ISP. If you have multiple connections, make sure not to click the one with the red X.
  4. Click the Properties button.
  5. Highlight Internet Protocol (TCP/IP) in the connection items list and click the Properties button.
  6. If not already selected, select the Use the following DNS server addresses option.
  7. Enter the new DNS addresses and click OK and close out of all other windows.

Windows 98

  1. Open Control Panel
  2. In the Control Panel window double-click the Network icon.
  3. Highlight TCP/IP Ethernet adapter in the connection items list and click the Properties button.
  4. In the Properties window, click the DNS Configuration tab and select Enable DNS.
  5. If any DNS Server is listed, highlight each and click the Remove button.
  6. Once no DNS is listed, type in the new addresses and click the Add button.
  7. Once the new addresses are added, click Ok and close out of all other windows.

Mac OS X

  1. From the Apple menu in the upper left hand corner of your screen, select System Preferences.
  2. From the System Preferences menu, select Network.
  3. In the Network menu, make sure your correct network device is highlighted on the left pane of the window Wi-Fi, for example. Click Advanced.
  4. In the advanced settings, click the DNS button to bring up DNS settings.
  5. In the left pane, you will see your current DNS server addresses. Write these down in case you need to revert your changes later.
  6. Highlight one of your current DNS addresses, and click the minus ("-") button underneath the left-hand pane to remove the highlighted address from the list. Do this for each of your current DNS addresses.
  7. Once the list is empty, click the plus ("+") button to add a new empty address (0.0.0.0). Highlight this address and type in a new one. Press Enter when you are done.
  8. Repeat step 7 for a secondary address, if you are adding one.
  9. Click OK to save the settings.
  10. Click Apply to apply your new network settings.

Linux

In Linux, the DNS server addresses are kept in the system file /etc/resolv.conf. (You need superuser privileges to edit this file.)

For instance, to edit this file with the nano text editor, use the command:

sudo nano /etc/resolv.conf

(We prefix the command with sudo to run nano with superuser permission.)

In your text editor, you will see the contents of /etc/resolv.conf. Each line that begins with the word nameserver contains a DNS address that is used by your system.

Once you have the file open, follow these steps:

  1. Make a note of the DNS addresses already listed. You may need this information later if you want to revert your changes.
  2. Delete any lines beginning with nameserver.
  3. For each DNS address you want to add, add a line which reads nameserver address, where address is the address of the DNS. For instance, in the image below, we are configuring our system to use the primary and secondary Google Public DNS.

Editing /etc/resolv.conf on a linux system with the nano text editor

  1. Save the file. In nano, this is CTRL-O, Enter.
  2. Exit the text editor. In nano, this is CTRL-X.

BSD

BSD's resolver uses the same file and format as Linux. Edit /etc/resolv.conf as root and add a nameserver address line for each DNS you want to use.

The same is true for Mac OS X, which a derivative of BSD. If you'd like to change your Mac's DNS addresses directly, edit the nameserver lines in /etc/resolv.conf as the root user.

Additional information

  • See the DNS and TCP/IP definitions for further information and related links.