Debian change DNS settings to a new DNS

Debian change DNS settings for speed improvement or privacy. It is really easy to do. So let us see how it’s done and get to it. The instructions are at the bottom of the article.

Why do you want to change DNS?

Some reasons to change DNS (Domain Name Server) is speed, privacy or avoid censorship from your ISP (Internet Service Provider).

Some internet providers have slow DNS. This will affect your speed when browsing on the internet. Because your computer needs to get the IP address for everything on the internet. Some web pages might need a lot of DNS lookups, and if your internet providers DNS is slow, your internet browsing will become slow.

When it comes to privacy, the DNS you use knows every address you have visited. Because it gave you the address for it. Who knows what the providers is doing with the data. They might sell it.

A common way to block websites is to remove the entry for the website in the DNS or set it to 0.0.0.0. This is how many internet providers blocked PirateBay and many other websites.

What DNS is available to use?

Several companies offer DNS for everyone to use. Google, Cloudflare, and OpenDNS are some of them. Who you trust is up to you. If you are concerned about privacy I would avoid Google.

Google: 8.8.8.8 & 8.8.4.4
Cloudflare: 1.1.1.1 & 1.0.0.1
OpenDNS: 208.67.222.222 & 208.67.220.220
Quad9: 9.9.9.9 & 149.112.112.112
CleanBrowsing: 185.228.168.9 & 185.228.169.9
Verisign: 64.6.64.6 & 64.6.65.6

These are just a few of the many available DNS you can use. Cloudflare claim to be the fastest one. OpenDNS is probably one of the more secure ones, as they don’t log any browsing and will never sell your data. Another option is to create your own DNS, but that will not be covered in this article. You can find more in this lifewire article.

How to change DNS in Debian?

The DNS address is in /etc/resolv.conf. This is how it might look like if your are using your default ISP DNS.

If we want to use Cloudflare’s DNS instead, we change it to this instead (only change nameserver for this):

domain home
search home
nameserver 1.1.1.1

Or you could also add the secondary DNS to, if the primary can’t be reached. I would recomend using the primary and secondary DNS.

domain home
search home
nameserver 1.1.1.1
nameserver 1.0.0.1

Debian change DNS is easy as you see. To verify that you are using Cloudflare DNS you can install dnsutils and do the following test.

dig any google.com

At the bottom note this part.

The server tells you where the DNS request came from. So this shows we are now using Cloudflare DNS instead of our ISP DNS. Also, note the query time was 11 milliseconds. That is fast. If your ISP DNS is slow it might take up to 100-200 milliseconds. That will have a huge impact on browsing speed, even if you have good download speed.

If you are interested in how to Change hostname, domain or FQDN permanently in debian, check it out.

About Author

Related Posts

php8 gd

PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it? In…

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

4 Best Free Nas Software That Is Open Source

Free NAS software or operating systems that are free to use and will turn a computer into a NAS more advanced than the dedicated boxes sold. What…

Raspbian default password

Raspbian default password

Looking for the Raspbian default password? It is the most essential username and password that you will need for your raspberry. At least if you are running…

OpenMediaVault default password

OpenMediaVault default password

OpenMediaVault default password is printed in the documentation. I did not see it the first time I installed it either. So I had to do some detective…

Upgrade debian 9 to debian 10

Upgrade Debian 9 to Debian 10

Upgrade Debian 9 to Debian 10 is very similar to upgrading previous versions. The only you need to do is change the sources to Buster instead of…

This Post Has 2 Comments

Leave a Reply