brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: resolvectl reset-server-features makes systemd-resolved forget what it learned about a server

Systemd
~/tips/tip-dns-resolvectl-show-server-state

resolvectl show-server-state

Shows what systemd-resolved knows about each DNS server and makes it probe again.

systemd-resolved probes the DNS servers it uses and remembers what each one can do. If a server had a bad moment, that memory can outlast the problem.

First look at what it knows:

resolvectl show-server-state

That shows detailed server state per DNS server, and you can add --json=pretty for a version a script can read. Then clear what it learned:

sudo resolvectl reset-server-features

The manual says this flushes all feature level information the resolver learnt about specific servers, and probing starts again from the beginning with the next lookup. It is mostly the same as sending SIGRTMIN+1 to the service, which helps when you read older posts.

I would try it after a router or upstream DNS change, or when a server answers fine with dig and still fails through the system resolver.

Caveats: it does not empty the answer cache. For that you still need resolvectl flush-caches, and the two together give you a fresh start. The versions differ too. According to the manual reset-server-features was added in systemd version 239 and show-server-state in version 255, so on a distribution in between you can reset the servers but not look at their state first.

Further reading: resolvectl(1) manual

More Systemd tips [Service] sudo mkdir -p /etc/systemd/system/service.d [Service] printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass – dbpass.cred systemd-analyze timespan 1h30min All Systemd tips (88) All topics

Link