DNS stands for Domain Name System. It is a translation service that converts a domain name to Ip address. DNS server is an implementation of DNS. Whenever you try to visit any URL, then the browser requests the IP address of that URL from the DNS server provided by your ISP, and the DNS Server in response to this request sends the corresponding IP address.
Why You Should Change Your DNS?
Sometimes the DNS server provided by ISP is not that much good. They might not have proper caching configured which may result in a slow connection. If some websites are not accessible on your network then changing your DNS might solve your problem. Some DNS service provider gives you the functionality to block certain websites on your network so changing your DNS to such service providers can give you more control over your network.
How to Change Your DNS?
There are two ways to change your DNS server:
- Change the DNS server of the complete network.
- Change the DNS server of a specific device.
Change DNS Server IP Address Of Router:
DNS server for a complete network can be updated by updating the DNS server address in your router. Here below is the general guide for every router:
- Visit the login page of your router, usually, the address for the login page is http://192.168.1.1, you can find this address at the back of your router.
- Enter Your login credentials and log in.
- Find network settings of the router and go to LAN settings and then search for DHCP server settings, there will be an option for adding custom DNS.
Network Settings -> LAN Settings -> DHCP Settings
In this case, the default DNS was 192.168.1.1, and we changed it to an Open DNS address i.e 220.127.116.11. (Please note that these are general instructions for every router, so for your router instructions can vary slightly).
Change DNS Server IP Address on a Specific Device
Change DNS on Mac: Open System preferences search for network and click on WiFi, go to advanced settings, and click on DNS. In DNS you will find an option to enter your custom DNS IP address.
System Preferences -> Network -> WiFi -> Advanced Settings -> DNS
You can also change the DNS on your mac using the terminal. Open Terminal and type the following command to change the DNS of your mac over Wi-Fi.
$ networksetup -setdnsservers Wi-Fi <Ip Address Of your custom DNS Server>
After executing this command your DNS will be changed, you can verify that your DNS is changed by executing the following command:
$ scutil --dns | grep 'nameserver\[[0-9]*\]'
Change DNS on Ubuntu: Open WiFi settings and click on the settings corresponding to your WiFi network then go to IPV4 and disable automatic DNS and enter your DNS server IP address and click on Apply.
WiFi Settings -> Your WiFi Network Settings -> ipv4
You can change DNS on Ubuntu using terminal also by typing the below commands –
$ nmcli connection show --active
This command will give you a list of active connections. Basically, this command is used to obtain the SSID of your network, this ssid will be used in the next command:
$ nmcli connection edit <your wifi ssid> nmcli > remove ipv4.dns nmcli > set ipv4.ignore-auto-dns yes nmcli > set ipv4.dns <your DNS Server Ip Address or Addresses> nmcli > save nmcli > quit
After executing these commands your DNS will be changed, you can verify that your DNS is changed by executing the following command:
$ nm-tool | grep DNS
Please note that you may have to restart your WiFi on Ubuntu for DNS changes to take place.
Change DNS on Android: Open WiFi settings on your android mobile after that open the settings of the WiFi network to which you are connected and after that add the IP address of your DNS server.
WiFi Settings -> Your WiFi Network Details
Change DNS on Windows
- Open the Control Panel from the Start menu.
- Click Network and Sharing Center.
- Click Change adapter settings.
- Right-click on your active network adapter & choose properties.
- Choose Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Enter the new DNS servers into the boxes under “Use the following DNS server addresses”.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.