You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1017 B
39 lines
1017 B
2 years ago
|
---
|
||
|
title: 'Systemd: flushing the DNS cache'
|
||
|
date: 2022-07-04T17:22:48+02:00
|
||
2 years ago
|
lastmod: 2022-12-14T16:05:48+01:00
|
||
2 years ago
|
categories: [computerstuff]
|
||
2 years ago
|
tags: [linux,systemd,networking,manjaro,dns]
|
||
2 years ago
|
|
||
|
---
|
||
|
|
||
|
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
|
||
1 year ago
|
Gentoo -- if someone cares about that more than I do).
|
||
2 years ago
|
|
||
2 years ago
|
<!--more-->
|
||
|
|
||
2 years ago
|
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
|
||
2 years ago
|
firewall at home made me use this very often over the last few weeks.
|
||
2 years ago
|
|
||
|
## Sources
|
||
|
|
||
|
- <https://devconnected.com/how-to-flush-dns-cache-on-linux/>
|