How to Change DNS Server. An In Depth Guide for All Platforms.
DNS servers are usually assigned to you by your ISP. You can change it to increase your internet speed or block certain websites. Another reason might be that websites are loading slower. Using a public DNS server is a good troubleshooting method to identify the problem. Regardless of the reason, I definitely suggest that you change your DNS server.
There are several ways to change your DNS server, but before we start, it’s important to understand how DNS works.
What is DNS?
DNS stands for Domain Name System, but surprisingly it is not a server. In simple terms, it is a system that translates a domain name (eg google.com) into its IP address (eg 18.104.22.168). The logic behind this is simple. We humans find it easier to remember words like Google or Facebook than a bunch of IP addresses. Therefore, we use the domain name everywhere. But machines don’t understand domain names, they only understand IP addresses.
Therefore, we use DNS to associate a domain name with its IP address. Basically, it is a large digital address book that contains a list of all websites and their IP addresses. So, your DNS server maintains a list of IP and DNS records. Every time you enter a DNS name in your browser, the DNS server translates it into an IP address.
How many DNS services are there?
There are a lot of them, but only a few are worth knowing. Below are the most popular ones with their features.
- GoogleDNS; for higher speed (22.214.171.124 and 126.96.36.199)
- OpenDNS; for parental control (188.8.131.52 and 184.108.40.206).
- Norton ConnectSafeDNS; suitable for protection and security against malware.
Read: 7 Best DNS Servers for Speed, Stability, and Security
So what’s the best DNS for me?
Depends on what you want to use it for. There is no better DNS server. Sometimes third-party DNS can help improve speed and security. And sometimes your ISP’s DNS is fine for downloading files from a server closest to you.
Thus, depending on your requirements, you can change the DNS of your computer, smartphone or router. Let’s see how.
How to change the DNS server
1. Change the DNS server on Windows 10/8/7
The shortest way to change your DNS server is through the command line. You just need to run one command. First, you need to open an elevated cmd. To do this, type cmd in the start menu. Right-click on the Command Prompt icon and select Run as Administrator.
Now that you have a command prompt, we need to check the name of our active network adapter. To do this, run the following command. ipconfig
The network adapter name is a single word suffixed at the end of the network header. In my case, it is the “Wi-Fi” suffix at the end of the wireless LAN adapter. So, the name of my network adapter is “Wi-Fi”. Once you get the name, run the following command to change the DNS server interface netsh ipv4 add dnsserver “Wi-Fi” 220.127.116.11 index = 1
Here netsh is the built-in Windows network configuration utility. “Wi-Fi” is the name of the adapter and you can replace it with the name of your adapter and index = 1 stands for the primary DNS server.
Change DNS Server on Windows 10/8/7 – GUI
If you are not good at command line, the easiest way to change the DNS server is through the GUI. You just need to go to adapter settings. To do this, go to the Start menu and type Network and Sharing Center . When the search results appear, click the network icon.
Additionally, in Windows 10, you can quickly open the Network and Sharing Center. Just right-click the start button and select Network Connections. You will immediately be taken to the network status window.
When the “Network Status” window opens, click “Change adapter settings”.
You will see the “Network Connection” pop-up window. Select your active connection. In my case it will be “Wi-Fi”, but if you are connected via a local network, select Ethernet. Right-click the active connection and select Properties.
When you get the Wi-Fi properties, select “Internet Protocol Version 4 (TCP / IPv4)”. After that, click Properties to open the IP Configuration Settings.
When you are in the opened IP Properties window, you should see the IP address configuration. The first menu is for IPv4 settings, but for now we are interested in setting up a DNS server. If you want to add a static IP address, you can make changes in this menu. For a detailed explanation, check out our article on how to assign a static IP. Go to the second menu and select “Use the following DNS server addresses”. This will activate text boxes where you must enter the IP address of the DNS server. There are 2 text boxes to enter “Preferred DNS Server” and “Alternate DNS Server”. Simply put, an alternate DNS server is used when your preferred DNS server is not available.
Then click OK to save the changes. You can check if your computer is using the same DNS server by running the following command in cmd. ipconfig / all
The problem with both methods is that you need to find the IP addresses of the public DNS servers. Moreover, there is no consolidated window for entering DNS IP addresses and registering your previous records. If you switch DNS frequently, it is recommended to use third party software such as DNS jumper. It’s free and portable, so you don’t need to install it. You can double-click an application to launch it. In the window that opens, you will see the “Select DNS Server” option. Below it, you see a dropdown with a pre-populated list of DNS servers. Select any and click “Apply DNS”.
You can also enter your own custom DNS servers. To see the changes, you must click on “Flush DNS”. There are several other features in the app such as checking DNS resolution times, applying DNS to all adapters.
Read: How to clear DNS cache in Chrome, Firefox and Safari
2. Change the DNS server on Ubuntu
In Ubuntu, the process of changing the DNS server is somewhat similar to Windows. You can do this through the command line or the graphical interface. The easiest way to do this is through a graphical interface. You just need to make some entries in the IP settings. To do this, click the network icon in the upper right corner.
After you click on the network icon, a tray will appear below it. Click on the active network adapter to open additional options from the drop-down list. Then click on Wired Network Settings.
Wait until the network settings window appears. Make sure you are on the Network tab and navigate to the active adapter. Click the Options icon next to an adapter to view its configurations.
When the wired network settings popup opens, go to the IPv4 tab to change the IP settings.
On the IPv4 tab, move the slider next to DNS to OFF. We now need to enter a static DNS IP in the text box below. If you have multiple DNS servers, you can separate them with commas. After successfully verifying the IP addresses, click Apply for the changes to take effect.
After you have applied the changes, we need to restart the network for the changes to take effect. You can just turn your Wi-Fi on and off, or rather, run this command on a terminal. sudo service network-manager restart
Now, to check if the network adapter is using the same DNS server, run the following command. nmcli dev show | grep DNS
You should see the IP addresses of the DNS servers you mentioned earlier. If you find any inconsistency, it must be because you left DNS as Automatic in your adapter settings. Go back, turn it off and restart the network manager. This should fix the problem.
2. Change the DNS server on the Mac
If you are using macOS, changing DNS is similar to Windows and Ubuntu, but much faster. We need to edit the network settings. To do this, click the Apple icon in the upper left corner of your desktop. Select System Preferences from the drop-down list.
When the System Preferences dialog box appears, go to Network and click on it to open the Network Settings.
Alternatively, you can also press Cmd + Space to launch Spotlight search. Enter “Network” in the search bar and click the icon when it appears. This will take you directly to the network settings.
In the pop-up window, select the active network interface. For example, I am connected to a Wi-Fi network, so my active network is Wi-Fi. Make sure you are on the active network tab and then click on Advanced.
A new window will open the configuration options for that adapter. Go to DNS settings by clicking the DNS tab.
Once you go to the DNS tab, you will see a “+” button in the lower left corner of the dialog box. Click the “+” button to add DNS servers and erase all previous ones. You can add as many as you like by clicking the “+” button. The order in which you enter the DNS IP addresses will determine the primary and secondary DNS servers. Click OK when finished.
On the network settings page, click Apply to check in the changes. Restart Wi-Fi for the changes to take effect. Your DNS server should now be the one you specified in your network settings.
3. Change DNS server on Android
In newer versions of Android, you have the option to change the DNS server natively. I am using Note 9 for this demo. But the steps to change the DNS server will be similar to this in most Android phones. We need to go to the settings menu and open Network and Connections. Once you’re on this page, click on Wi-Fi.
When you are on the Wi-Fi settings page, you will see an active Wi-Fi connection at the top. Click on it to go to a specific Wi-Fi configuration page.
On the Wi-Fi configuration page go to “Advanced”. Typically, this will be at the bottom of all options.
When you click Advanced, you will be taken to the advanced section page. On standard Android, you will see a popup. In any case, the default IP settings will be set to “DHCP”. This way you won’t see any DNS settings. You need to switch to static in order to change your DNS server.
Once you switch your IP settings to static, you will see a lot of text fields. Go to DNS1 and DNS2. Here you can enter your primary and secondary DNS servers. Now click the “Save” button for the changes to take effect.
The problem with this method is that you can only set 2 DNS servers and this is too SSID specific. A third-party app might be the solution, but most of them don’t work on Android 7 and above. If you have a lower version of Android like Lollipop, you can try the Wi-Fi Settings app.
4. Change DNS server on iPad / iPhone
If you are using iOS, the actions are very similar to those for Android. Go to the settings menu by clicking on the settings icon. It should be in the lower right corner of the screen on the dock.
Click on Wi-Fi and under the Wi-Fi options, you will see the Wi-Fi you are connected to at the top of the list. When you get to the Wi-Fi page, press the “i” button next to the Wi-Fi you are connected to.
You will now see details such as the IP address of your device, router, etc. Then click on “Configure DNS”.
Select guide and delete all previous IP addresses. Once cleared, add the IP addresses of the new DNS server by clicking Add Search Domain and then return to save your changes.
Your phone should now start using the DNS server you configured.
5. Change the DNS server at the router level
The problem with all of the above methods is that you are changing DNS on a specific device. If you have access to your router, consider changing the DNS on it. Thus, this applies to all devices that connect to the network. This saves time and configuration.
Each router is different and has its own user interface. I am using a Netgear router with a custom ROM dd-wrt. So, the steps for you will not be identical, but somewhat similar. First, log into the router’s web portal. The web portal address, username and password are in most cases printed behind the router. If you don’t have physical access to your router, the web portal URL is basically the gateway address of your PC. To find this, open a command prompt and enter the following command. ipconfig | findstr “Default Gateway”
After loading the web portal, log in with your credentials. Now each router has a different web interface, but the overall structure remains the same. Go to the main settings page on the Settings tab.
Once you get to the basic setup page, navigate to the network address server (DHCP) settings. You will have text fields for entering DNS IP addresses. Enter them in order of preference. Click “Save” and then “Apply Settings”.
If you have access to a router, then I would recommend setting up DNS on the router. In case you don’t have access to the router and you are on an office network, the second best way is to configure it locally. Once you have configured DNS on your local device, it will override your router’s settings. It’s also possible that your device is still not using the same DNS.
Read: How DNS Server Is Not Responding “in Windows 10