Summary

The domain name resolving service is enabled by default in Ubuntu.

Thats fine, it performs a useful service.

But its worth periodically flushing its buffers, especially if you get flaky connectivity.

A laptop running Ubuntu with a Linux Terminal open

Hannah Stryker / How-To Geek

What Is DNS Caching?

Thedomain name system(DNS) service eats names and spits out numbers.

Matching names to IP addresses is calledresolving.

Checking whether the resolved daemon is running on Ubuntu

Lookups are very fast, but theyre not instantaneous.

The answer is sent back from the cache.

Ubuntu adds its own cache to the mix.

Checking the size of the DNS cache on Ubuntu

By default, thesystemd-resolved service is enabled.

This caches DNS requests and responses.

What Does Flushing the DNS Cache Do?

Flushing the DNS cache on Ubuntu

The response will be cached.

Its an easy and safe operation.

Flushing the DNS Cache on Ubuntu

On Ubuntu, the DNS service is on by default.

Verifying the DNS cache is empty on Ubuntu

The command to use is straightforward.

This is the systemd name resolving daemon.

The response will either be active or inactive.

Selecting the DNS option in the Firefox sidebar

Well check again, once weve flushed the buffers.

This time, were using the resolvectl command to manipulate systemd-resolved directly.

Because this is a fresh installation of Ubuntu, there are relatively few entries in the cache.

The Clear DNS Cache button on Firefox

Regardless, when we flush the DNS buffers we expect to see that number drop to zero.

Were silently returned to the command line.

No output means everything went well.

The Firefox DNS page with no entries, showing the cache has been purged

Lets see what our cache size is now.

Our cache size is zero, just as we predicted.

Dont Forget Your internet tool’s Cache

Your internet browsers have their own caches.

The Firefox DNS page with no entries, showing the cache has been purged

Firefox shows you the most recent entries added to the DNS cache.

To dump the cache, tap the Clear DNS Cache button.

I had to refresh the page to see the change, but the cache was definitely purged.

Theres no visible feedback to let you know anything has actually happened, but behind the scenes it has.

Google Chromes DNS cache has been emptied.

Its easy to do, so it makes sense to do it as a first step.

And with a bit of luck, your issue might be solved.