[systemd-devel] "resolvectl -i INTERFACE query" fails if global DNS is used

Wang Bing-hua louiswpf at gmail.com
Mon May 23 16:06:50 UTC 2022


Hi all,

"resolvectl -i INTERFACE query" fails if global DNS is used. [1]

I might be mistaken, but according to resolvectl man page [2],
"resolvectl -i INTERFACE query" should be equivalent to "resolvectl query" in
this case, and it should resolve domain names successfully.

[1]
$ resolvectl
Global
  Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=yes/supported
  resolv.conf mode: stub
  Current DNS Server: 1.1.1.1#cloudflare-dns.com
Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google
  2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net
  2001:4860:4860::8888#dns.google

Link 2 (enp7s0)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
  Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=yes/supported

$ resolvectl query www.google.com
www.google.com: 2404:6800:4012::2004  -- link: enp7s0
  172.217.160.68  -- link: enp7s0

-- Information acquired via protocol DNS in 138.3ms.
-- Data is authenticated: no; Data was acquired via local or encrypted transport: no
-- Data from: cache network

$ resolvectl query -i enp7s0 www.google.com
www.google.com: resolve call failed: No appropriate name servers or networks for name found

[2] https://www.freedesktop.org/software/systemd/man/resolvectl.html#-i%20INTERFACE
-i INTERFACE, --interface=INTERFACE
  Specifies the network interface to execute the query on. This may either be specified as
  numeric interface index or as network interface string (e.g.  "en0"). Note that this
  option has no effect if system-wide DNS configuration (as configured in /etc/resolv.conf
  or /etc/systemd/resolved.conf) in place of per-link configuration is used.

Thanks,
Bing-Hua


More information about the systemd-devel mailing list