Vol. I · No. 46The command line sectionSat, 10 Oct 2026
Linux · names

resolvectl

who this host really asks

On a systemd machine /etc/resolv.conf usually names only 127.0.0.53, a local stub. resolvectl shows what lies behind it: the real resolvers, per interface, and which link a given name will be sent to. With a VPN up there are two sets of DNS servers at once, and this is the only place that says so.

Name resolution on a modern host is per link, not per machine — the question is which interface gets the query.

Talks to
systemd-resolved
the local stub resolver
Stub address
127.0.0.53
what resolv.conf points at
Resolves like
The host
unlike dig
Older name
systemd-resolve
same tool, renamed

At the terminal

Read the session first, then the notes: each numbered line in the output is answered by the note with the same number.

user@netflow — bashsystemd
$ resolvectl status
Global
1 Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
2resolv.conf mode: stub
 
Link 2 (eth0)
Current Scopes: DNS
3Current DNS Server: 192.168.1.1
DNS Servers: 192.168.1.1
DNS Domain: lan
 
Link 5 (wg0)
Current Scopes: DNS
Current DNS Server: 10.8.0.1
DNS Servers: 10.8.0.1
4 DNS Domain: ~corp.example
Illustrative session · names, sizes and dates are examples, and every address is from a documentation or private range
Reading the output

What the numbered lines are telling you

1
The protocol line is the feature list

A minus means off. Here multicast names, LLMNR and DNS-over-TLS are all disabled, and answers are not DNSSEC-validated.

2
stub mode explains resolv.conf

Applications are told to ask 127.0.0.53, and systemd-resolved forwards from there. The real servers never appear in the file.

3
Each link has its own resolver

eth0 learned 192.168.1.1 from DHCP. "Current" is the one in use when several are listed.

4
The tilde makes a routing domain

~corp.example sends names under corp.example to the VPN's resolver and nothing else. Without the tilde it would also be a search suffix.

Switches

A switch changes how the command behaves. These are the ones used day to day; man resolvectl lists the rest. Single-letter switches can usually be joined, so -l -a may be written -la.

-t TYPE
With query, ask for a record type such as MX or TXT.
-i IFACE
Limit the command to one interface.
-4
Resolve to IPv4 addresses only.
-6
Resolve to IPv6 addresses only.
--no-pager
Print straight to the terminal instead of opening a pager.

Variations worth knowing

The same tool, pointed at a narrower question. These four cover most of what it is reached for day to day.

resolvectl query example.com

Resolves a name the way an application would, and reports which link and protocol answered.

resolvectl flush-caches

Empties the local cache — the step to take after changing a record and still seeing the old answer.

resolvectl dns eth0 192.0.2.53

Sets the resolver for one link until the next network change.

resolvectl statistics

Cache hits and misses, and how many answers passed or failed DNSSEC validation.

In cybersecurity

The resolver a host uses sees every name it looks up and can answer with any address it likes. Knowing exactly which one that is matters more than which firewall is in front.

DNS leaks

With a VPN up, queries for public names may still go out of eth0 to the local network's resolver. The per-link view shows it.

A resolver from DHCP

Any network that hands out a lease also hands out a DNS server. On untrusted Wi-Fi, that is the network operator's choice, not yours.

LLMNR and mDNS

Both answer names by asking the whole segment, and anyone may reply. Disable them where they are not needed.

DNS over TLS

DNSOverTLS=yes encrypts queries to the resolver, hiding them from the local network — though not from the resolver.

Validation off

DNSSEC=no means forged answers are accepted without complaint. Know which of your hosts validate.

Cache poisoning

A bad answer is cached for its whole TTL. Flushing is part of cleaning up after a DNS incident.

Protocols it shows

DNSmDNSDHCPTLS

Read alongside