Improve DNS Performance: Setup DNS to 8.8.8.8 in Linux

Now you can setup your DNS server to 8.8.8.8 in Linux by following the below steps. The DNS translates domain names into IP addresses and acts as a directory service for the internet, which is responsible for resolving domain names to IP addresses. If you see by default, your Linux system will use the DNS servers provided by your internet service provider, but you might want to use a different DNS server for various reasons. By opting 8.8.8.8 as your DNS server, you tap into the services provided by Google’s Public DNS, known for its speed, reliability, and security.

Check the current DNS Server

First, you must check the current DNS server before setting it to 8.8.8.8. Check the current DNS server by entering the following command in the terminal window:

cat /etc/resolv.conf

Edit /etc/resolv.conf file

A configuration file called /etc/resolv.conf contains information about which DNS servers to use.

Now you want to edit the required file to set the DNS server to 8.8.8.8. Enter the following command into the terminal window:

sudo nano /etc/resolv.conf

When you run the above command, the /etc/resolv.conf file will open in the nano editor. Next, add the following command at the beginning of the file and save the file.

nameserver 8.8.8.8

Setup the DNS Server using Network Manager

If you are using the desktop version, then the graphical interface of Network Manager can be used to configure the DNS server. Follow the below steps to configure the setup:

  1. Select the network icon in the system tray.
  2. Click the Network Configuration or Network Setting.
  3. Choose your network connection and click the gear icon.
  4. Now, depending on the network configuration, select the IP version – IPv4 or IPv6.
  5. Select the “Manual” in the DNS Section and add 8.8.8.8 in the server list.
  6. Finally apply and close the window.

Setup the DNS server using systemd-resolved

If you are using the latest version of Linux that supports systemd-resolved, then you can follow the below steps to configure the DNS server:

  1. First, open the terminal window and enter the following command:
 sudo systemctl edit systemd-resolved
  1. The above command will open a new file in the text editor. Now add the command to the file:
[Resolve]

DNS=8.8.8.8
  1. Save and exit the file. Then restart the systemd-resolved with the below command:
 sudo systemctl restart systemd-resolved

Verify the DNS Server

After configuring the DNS server to 8.8.8.8, you should finally ensure that everything works well. Verify the configuring with the following command:

nslookup example.com

Note: Replace the example.com with any domain name.

Hope these steps helped you set your DNS server to 8.8.8.8 which will lead to a faster, more reliable, and potentially more secure internet browsing experience. If you need any assistance in the setup feel free to reach us.

Check: Troubleshoot Client VPN Connection – Linux

To get more updates you can follow us on Facebook, Twitter, LinkedIn

Subscribe to get free blog content to your Inbox
Loading

Written by actsupp-r0cks