How to change Google DNS on Linux

In the previous article, TipsMake.com showed you how to change Google DNS on a Mac. Today, let's find out how to change DNS on Linux and its distributions.

In the previous article, TipsMake.com showed you how to change Google DNS on a Mac. Today, let's find out how to change DNS on Linux and its distributions.

In most modern Linux distributions, DNS settings are configured via Network Manager.

  1. How to change DNS to be able to surf faster, don't worry about being blocked
  2. How to change DNS Quad9 to block malicious domain
  3. Top 7 best free antivirus software for Linux

Change server settings on Ubuntu.

1. First, you need to access System> Preferences> Network Connections.

2. Select the connection you want to configure Google Public DNS. For example:

  1. To change the settings for Ethernet connection, click the Wired tab , then select your network interface in the list (commonly called eth0).
  2. To change the settings for wireless connection, click the Wireless tab , then select the appropriate wireless network.

3. Next, click Edit, then select the IPv4 Settings or IPv6 Settings tab .

4. If the method is selected as Automatic (DHCP) , open the drop-down list and select Automatic (DHCP) addresses only. If the method is set to something else, don't change anything.

How to change Google DNS on Linux Picture 1How to change Google DNS on Linux Picture 1

5. In the DNS servers field, enter Google Public DNS IP addresses, separated by commas:

  1. For IPv4: 8.8.8.8 and 8.8.4.4.
  2. For IPv6: 2001: 4860: 4860 :: 8888 and 2001: 4860: 4860 :: 8844.
  3. For IPv6-only: You can use Google Public DNS64 to replace the above IPv6 addresses.

6. Click Apply to save the changes. If you are prompted to confirm, enter your password.

7. To check if your settings are working properly, please refer to the article at the end of the article.

8. Repeat the procedure for additional network connections you want to change.

If your distribution does not use Network Manager, your DNS settings will be specified in /etc/resolv.conf.

Change DNS server settings on Debian servers.

/Etc/resolv.conf edit :

 sudo vi / etc / resolv . conf 

If any of the nameserver lines appear, write down the IP addresses for reference if needed.

Replace the nameserver lines or add the following lines:

For IPv4:

nameserver 8.8.8.8
nameserver 8.8.4.4

For IPv6:

nameserver 2001: 4860: 4860 :: 8888
nameserver 2001: 4860: 4860 :: 8844

For IPv6-only, you can use Google Public DNS64 instead of the above IPv6 address.

Save and exit.

Restart the Internet clients you are using.

Check if your settings are working properly by using the link at the bottom of the article.

Also, if you are using the DHCP client software to override the settings in the /etc/resolv.conf file, you will need to install the client by editing the client's configuration file.

Configure DHCP client software on Debian servers.

Backup /etc/resolv.conf:

 sudo cp / etc / resolv . conf / etc / resolv . conf . auto 

Edit /etc/dhcp3/dhclient.conf:

 sudo vi / etc / dhcp3 / dhclient . conf 

If there is a line containing domain-name-servers, write the IP addresses for future reference.

Replace the line containing domain-name-servers with or add the following line:

For IPv4:

 prepend domain - name - servers 8.8 . 8.8 , 8.8 . 4.4 ; 

For IPv6:

 prepend domain - name - servers 2001 : 4860 : 4860 :: 8888 , 2001 : 4860 : 4860 :: 8844 ; 

For IPv6-only, you can use Google Public DNS64 instead of the above IPv6 address.

Save and exit.

Check that your settings are working properly by referring to the article below.

The link to check for new DNS settings is correct: Instructions for checking Google DNS settings after changes

Good luck.

You can refer to: The best and fastest DNS list of Google, VNPT, FPT, Viettel, Singapore

3.6 ★ | 7 Vote