How-Tos

How-To: See Which DNS Servers Your Linux Box Really Uses With resolvectl

Leave a comment

When name resolution acts weird on a Linux machine, the first question is “who is actually answering?” On any distro using systemd-resolved (Arch, Omarchy, Ubuntu and plenty more), resolvectl answers it in seconds.

1. Is systemd-resolved even in charge?

ls -l /etc/resolv.conf
systemctl is-active systemd-resolved

If /etc/resolv.conf links to stub-resolv.conf, resolved is handling DNS. If it’s a plain file, something else is, and you’ll want to read it directly.

2. See the DNS servers per interface

resolvectl status

Each link (Wi-Fi, Ethernet, a VPN or tailnet interface) gets its own servers and search domains. This is where you spot a VPN quietly taking over all your lookups, or a DHCP server pushing DNS you didn’t expect.

3. Ask a question and see who answered

resolvectl query example.com

The output tells you which link the answer came from, how long it took, and whether it was authenticated.

4. Check the cache

resolvectl statistics
sudo resolvectl flush-caches

Flushing is handy after you change records or switch filtering providers.

5. Sanity-check against one server

dig @1.1.1.1 example.com +short

If a direct query works and resolvectl query doesn’t, the problem is local config, not the internet. That one comparison saves a lot of guessing.

God Bless, and Use the Source!

References & Further Reading

Subscribe (RSS) Follow How-Tos via RSS

Leave a note

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.