oe7drt-website/content/posts/2022-07-04-systemd-flushing-the-dns-cache/index.md

39 lines
1 KiB
Markdown
Raw Normal View History

---
title: 'Systemd: flushing the DNS cache'
date: 2022-07-04T17:22:48+02:00
2022-12-14 16:07:25 +01:00
lastmod: 2022-12-14T16:05:48+01:00
categories: [computerstuff]
tags: [linux,systemd,networking,manjaro,dns,reminders]
---
First off I want to say, that Systemd is quite new to me and I always used the
old and classic init systems like OpenRC (which is still available on
Gentoo---if someone cares about that more than I do).
2022-12-14 16:07:25 +01:00
<!--more-->
Now let's start right away, flushing the DNS cache on a linux box using Systemd
is not that complicated, but the correct commands should be known.
And this post is all about that:
~~~console
$ sudo systemd-resolve --flush-caches
~~~
You could also use `sudo resolvectl flush-caches` if you like or prefer.
Now verify the empty cache:
~~~console
$ systemd-resolve --statistics
~~~
I usually do not need to flush my computers DNS caches, but fiddling with my
2022-12-05 22:32:44 +01:00
firewall at home made me use this very often over the last few weeks.
## Sources
- <https://devconnected.com/how-to-flush-dns-cache-on-linux/>