How to Change DNS Server. An In Depth Guide for All Platforms

DNS Servers are usually assigned to you by your ISP. You may want to change it for a better Internet speed or for blocking certain websites. Other reasons might be that websites are loading slower. Using a public DNS server helps is a good troubleshooting method to identify the problem. Irrespective of the reason, I would definitely suggest that you change your DNS Server.

Here are several ways to change your DNS Server, But before we begin it’s important to understand how DNS works.

What is DNS?

DNS stands for Domain Name System, surprisingly it’s not Server. In simple words, it’s a system, that translates the domain name (like google.com) to its IP address (like 216.58.196.110). The logic behind it is simple. For us humans, it’s easy to remember words like Google or Facebook than a bunch of IP address. So we use domain name everywhere. But machines don’t understand domain names, they only understand IP addresses.

So we use DNS to link a domain name to its IP address. Basically, it’s a big digital address book, that contains the list of all websites and their IP address. So, your DNS server maintains a list of IP and DNS entries. Every time, when you type a DNS name on the browser, the DNS server resolves it to an IP Address.

How many DNS services are there?

Tons of them but only some of them are worth knowing. Following are the most popular ones with their features.

  • GoogleDNS; for faster speed (8.8.8.8 and 8.8.4.4)
  • OpenDNS; for parental control (208.67.222.222 and 208.67.220.220 ).
  • Norton ConnectSafeDNS; good for malware protection and safety.

Read: 7 Best DNS Servers For Speed, Stability, and Security

So which is the best DNS for me?

Depends on what you want to use it for. There is no best DNS server. Sometimes third-party DNS is good for speed and security. And sometimes your ISP’s DNS is suitable for downloading files from the server near you.

So depending on your requirement you can change DNS of your computer, smartphone or your router. Let’s see how.

How to change DNS Server

1. Change DNS Server on Windows 10/8/7

The shortest way to change your DNS server is via command line. You just need to run a single command. Firstly, you need to open cmd with elevated permissions. To do that, type cmd on the Start Menu. Right-click on the Command Prompt icon and select “Run as Administrator“.

CommandPrompt

Now, once you have the command prompt, we need to check our active network adapter name. To do that, run the following command.

ipconfig

active_adapter_name

The Network Adapter name is a single word suffixed at the end of the Network Title. In my case, it is “Wi-Fi” suffixed at the end of Wireless LAN adapter. So, my Network Adapter Name is “Wi-Fi”. Once you have the name, run the following command to change the DNS Server

netsh interface ipv4 add dnsserver "Wi-Fi" 8.8.8.8 index=1

Here, netsh is a built-in Windows Network configuration utility. “Wi-Fi” is the adapter name and you can replace it by your adapter name and index=1 means the primary DNS Server.

netsh_add_dns

Change DNS Server on Windows 10/8/7 – GUI

In case you are not good with the command line, the simplest way to change DNS Server would be through the GUI. You just need to navigate to the Adapter settings. To do that, go to the Start menu and type in Network and Sharing CenterOnce the search results pop up, Click on the Network icon.

Network_And_Sharing_Center

Alternatively, on Windows 10, you can quickly open the Network and Sharing center. Just right-click on the Start button and click on “Network Connections“. This will directly take you to the Network Status window.

RightClickOnStartMenu_Windows10

Once the Network Status window opens, click on “Change adapter options“.

Change_Adapter_Options

You will see the Network Connection window popup. Select your active connection. In my case, it would be “Wi-Fi” but if you are connected by LAN, choose Ethernet. Right click on the active connection, and click on “Properties”.

Right_Click_NetworkAdapter

When you get the Wi-Fi Properties, select “Internet Protocol Version 4 (TCP/IPv4)“. Once done, click on Properties to open the IP configuration settings.

IPv4_Properties

Once you are in the IP Properties window opens up, you should see the IP Address Configuration. The first menu is for IPv4 settings but at the moment we are interested in setting the DNS Server. In case you want to add a static IP, you can make changes in this menu. For a detailed explanation, check out our article on how to assign static IP. Go to the second menu and choose “Use the following DNS server addresses“. This will enable the text fields where you have to enter the DNS Server IP Address. There are 2 text fields for you to enter “Preferred DNS Server” and “Alternate DNS Server”. In simple terms, Alternate DNS Server is used when your Preferred DNS Server is not reachable

DNS_IP_Server_Address

Once done, click on OK to save the changes. You can verify if your PC is using the same DNS server by running the following command on cmd.

ipconfig /all

cmd_dns_server

The problem with both the methods is that you have to find public DNS Servers IPs. Moreover, there is no consolidated window to enter DNS IPs and log your previous entries. If you switch DNS frequently then it would be recommended to use third-party software like DNS jumper. It is a freeware and a portable utility so you don’t need to install it the software. You can double-click the application to run it. Once the window opens, you see an option called “Choose a DNS Server”. Below it, you see a drop-down with a pre-populated list of DNS servers. Select any one and click on “Apply DNS”.

DNS_Jumper_App_Interface

You can also choose to enter your own Custom DNS Servers. To see the changes, you have to click on “Flush DNS”. There are several other features in the app like checking DNS resolve time, applying DNS to all adapters.

Read: How to Clear DNS Cache on Chrome, Firefox and Safari

2. Change DNS Server on Ubuntu

On Ubuntu, the process to change the DNS Server is somewhat similar to Windows. You can do it via the command line or GUI. The simplest way to do it would be through the GUI. You just need to make a few entries in the IP settings. To do that, click on the network icon at the top-right corner.

Ubuntu_Network_Icon

Once you click on the Network icon, a tray will appear below it. Click on the active network adapter to bring up more options in the dropdown. Next, click on the “Wired Settings”.

Wired_Settings

Wait until the Network Settings window pops up. Make sure you are on the Network tab and navigate to the adapter which is active. Click on the Settings icon beside the adapter to view its configurations.

Wired_Settings_Icon

When you get the wired settings pop-up window, navigate to the IPv4 tab to change the IP settings.

IPv4_Tab

On the IPv4 tab, toggle the slider beside the DNS to “OFF”. Now, we need to enter the static DNS IP in the text field below. If you have multiple DNS Servers you can separate them by a comma. Once the IPs are validated successfully, click on Apply for the changes to take effect.

Static_DNS_Ubuntu_GUI

Once you have applied the changes, we need to restart the network for changes to take effect. You can just turn on and off your Wi-Fi or rather run this command on the terminal.

sudo service network-manager restart

network-manager_restart

Now, in order to check if the network adapter is using the same DNS server, run the following command.

nmcli dev show | grep DNS

nmcli_dev_dns_address

You should see the DNS Server IPs you have mentioned previously. If you find any discrepancy, it should be because you have left DNS as Automatic in adapter settings. Go back, turn it off and restart your network-manager. This should fix the problem.

2. Change DNS Server on Mac

If you are using macOS, changing DNS is similar to Windows and Ubuntu but way quicker. We need to edit the network settings. To do that, click on the Apple icon at the top left corner of the desktop. Click on System Preferences from the dropdown list.

mac_systemPreferences

Once the System Preferences dialogue box displays, navigate to Network and click on it to open the Network Settings

Network_Symbol

Alternatively, you can also hit Cmd+Space to trigger the Spotlight search. Type “Network” in the search bar and click on the icon once it appears. This will directly navigate you to the Network Settings.

network_on_spotlight

From the pop-up window, select an active network interface. For example, I am connected to a WiFi network so my active network is Wi-Fi. Make sure you are on the active network tab and then click on Advanced.

Network_Settings_menu

A new window will open the configuration settings for that adapter. Move over to the DNS settings by clicking on the DNS tab.

macOS_DNS_tab

Once you get into the DNS tab, you will see a “+” button at the left-bottom of the dialogue box. Click on the “+” button to add DNS Servers and wipe all the previous ones. You can add as many as you want by clicking on the “+” button. The order in which you enter the DNS IPs will decide the primary and secondary DNS Servers. Click on “Ok” when you are done.

static_DNS_mac

On the network settings page, click Apply for the changes to register. Restart the Wi-Fi for changes to take effect. Now, your DNS server should be the one you have specified in the network settings.

3. Change DNS Server on Android

In the newer versions of Android, you have the option to change the DNS Server natively. I am using a Note 9 for this demonstration. But the steps to change DNS Server would be similar to this in most of the Android phones. We need to go to the Settings menu and open Network and Connections. Once you are on that page, click on “Wi-Fi”.

Android_Wi-Fi_Settings

When you on the Wi-Fi settings page, on top you will see the active Wi-Fi connection. Tap on it to get to the specific Wi-Fi configuration page.

Android_tap_on-WiFi

On the Wi-Fi configuration page, navigate to “Advanced“. Generally, it would be at the bottom of all the options.

WiFi_Settings_Advanced

When you tap on “Advanced“, you will be guided to the advance section page. On the stock Android version, you will get a pop-up. Anyways, the IP settings would be set to “DHCP” by default. So, you won’t see any DNS Settings. You need to switch to Static to change your DNS Server.

IP_Settings_DHCP

Once you switch the IP settings to Static, you will see a lot of text fields appear. Navigate to DNS1 and DNS2. Here, you can enter your primary and secondary DNS Servers. Now, tap on the Save button for the changes to take effect.

set_DNS_Server

The problem with this method is you can only set 2 DNS Servers and that too specific to an SSID. Now, a third-party app can be a solution but most of them don’t work on Android version 7 and above. If you are on a lower Android Version like Lollipop, you can try the Wi-Fi Settings app.

4. Change DNS Server on iPad/iPhone

If you are on iOS, the steps are quite similar to that of Android. Head over to the Settings menu by tapping on the Settings icon. It should be at the bottom right of the screen on the dock.

wifi_Settings_ios

Tap on the Wi-Fi and under the Wifi options, you will see the Wi-Fi which you are connected at the top of the list. Once you are in the Wi-Fi page, tap on the “i” button next to the Wi-Fi you are connected to.

i_button_wifi

You’ll now see details like IP address of your device and router etc. Next, tap on the “Configure DNS” option.

configure_DNS

Choose manual and delete all the previous IP address. Once cleared add new DNS server IPs by clicking on “Add Search Domain” and then go back to save changes.

save_DNS_Page_ios

Now, your phone should start using the DNS Server you have configured.

5. Change DNS Server on Router Level

The problem with all the above-mentioned methods is that you are changing the DNS on the particular device. If you have access to the router, consider changing DNS on it. This way it is applicable to all devices that connect to the network. It saves time and configuration.

Every router is different and has a different UI. I am on a Netgear router with a custom ROM dd-wrt. So, the steps won’t be identical for you but somewhat similar. Firstly, login to the web portal of the router. The web portal address, username, and password are mostly printed behind the router. In case you don’t have physical access to the router, the web portal URL is mostly the PC’s gateway address. To find that, open command prompt and type the following command.

ipconfig | findstr "Default Gateway"

Once you have the web portal loaded, log in with the credentials. Now every router has a different web UI, but the overall structure is the same. Move over to the Basic setup page under the Setup tab.

router_setup_page

Once you are in the basic setup page, navigate to the Network Address Server Settings (DHCP). You will have text fields to enter the DNS IPs. Enter them in the order of preference. Click on Save and then “Apply Settings“.

router_dns_ip_set

Wrapping Up

If you have access to the router, then I would recommend configuring DNS on the router. In case, you don’t have access to the router and you are in an office network, the second best method would be to configure it locally. Once you have configured DNS on the local device it would override the settings on your router. There are also possible chances that your device is still not using the same DNS.

Read: How to The DNS Server Isn’t Responding” in Windows 10

About Pratik

Pratik works as an In-House writer at TechWiser!