We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

DNS lookups are not normally something that you’re gonna wanna worry about.

How will a caching DNS server help me?

Finally,systemd-resolvedsupports the very latest, secure DNS standards DNSSEC and DNSoverTLS orDoT.

These help keep you secure and retain your privacy online.

Which local caching DNS will we use?

The local caching DNS server that we will enable and configure in this guide is systemd-resolved.

This tool is a part of the systemd suite of system management tools.

Most distributions do not use systemd-resolved even though it is present.

systemd-resolvedworks by running a small local caching DNS server which we will configure to start on boot.

How to look to see if you are already using systemd-resolved?

Some Linux distributions are already using systemd-resolved by default such as Ubuntu 19.04.

If you are already runningsystemd-resolvedthen you do not need to enable it or configure your system to use it.

Enabling and configuring systemd-resolved

We do not need to install systemd-resolved as already a part of systemd.

Here, the Cloudflare DNS servers are shown:

Save and exit the text editor.

The first is the recommended configuration, and the second is the compatibility configuration.

The difference between the two is how the/etc/resolv.conffile is managed.

The /etc/resolv.conf file holds the IP addresses of the nameservers that programs on the system should query.

The two modes of systemd-resolved center around how the contents of this file are managed.

In the recommended mode, /etc/resolv.conf is made a symlink to /run/systemd/resolve/stub-resolv.conf.

This can cause problems when other programs take a stab at manage the contents of /etc/resolv.conf.

Compatibility mode leaves /etc/resolv.conf in place allowing other programs to manage it while systemd-resolved uses that DNS information.

When we configure this modesystemd-resolvedwill manage/etc/resolv.confby making it a symlink to /run/systemd/resolve/stub-resolv.conf.

We will need to do this by hand as it is not configured automatically.

First, delete or rename the existing /etc/resolv.conf file.

:

Tells you exactly which DNS server is being used for DNS queries.

In this case, the Cloudflare DNS server at 1.1.1.1 was queried.

Lines that being Cache miss indicate that the domain name has not been cached.

:

Lines that begin Positive cache hit e.g.

The Google and Cloudflare public DNS servers both support these protocols.

If you are Linux enthusiast and looking to learn more, then check out this fantasticonline course.