Repository navigation
Description
systemd version the issue has been seen with
251.2
Used distribution
Archlinux
Linux kernel version used (uname -a)
Linux hostname 5.18.0-arch1-1 #1 SMP PREEMPT_DYNAMIC Tue, 24 May 2022 22:00:36 +0000 x86_64 GNU/Linux
CPU architecture issue was seen on
x86_64
Expected behaviour you didn't see
No network requests are made, according to the
PROTOCOLS AND ROUTINGsection ofsystemd-resolved.service(8)
Unexpected behaviour you saw
If a search domain is configured (from DHCP, for example), systemd-resolved will attempt to query the network to resolve the machine hostname. Since
hostname.searchdomainwon't exist, no result is returned for this query.
Since apparently my ISP's router has a very broken DNS implementation, I get a timeout error instead. This timeout greatly increases the startup time for programs like Firefox, which attempt to resolve the hostname at launch.
Steps to reproduce the problem
- Have a terrible router (optional)
- Configure a search domain for the interface
- Make sure the hostname isn't present in
/etc/hosts- Run
resolvectl query $(hostname)
Additional program output to the terminal or log subsystem illustrating the issue
systemd-resolved[153542]: Looking up RR for hostname IN A.
systemd-resolved[153542]: Looking up RR for hostname IN AAAA.
systemd-resolved[153542]: Cache miss for hostname.mygateway IN A
systemd-resolved[153542]: Firing regular transaction 40417 for <hostname.mygateway IN A> scope dns on wlan0/* (validate=yes).
systemd-resolved[153542]: Using feature level UDP+EDNS0 for transaction 40417.
systemd-resolved[153542]: Using DNS server 1.1.1.1 for transaction 40417.
systemd-resolved[153542]: Announcing packet size 1472 in egress EDNS(0) packet.
systemd-resolved[153542]: Emitting UDP, link MTU is 1500, socket MTU is 0, minimal MTU is 40
systemd-resolved[153542]: Sending query packet with id 40417 of size 47.
systemd-resolved[153542]: Cache miss for hostname.mygateway IN AAAA
systemd-resolved[153542]: Firing regular transaction 4147 for <hostname.mygateway IN AAAA> scope dns on wlan0/* (validate=yes).
systemd-resolved[153542]: Using feature level UDP+EDNS0 for transaction 4147.
systemd-resolved[153542]: Using DNS server 1.1.1.1 for transaction 4147.
systemd-resolved[153542]: Announcing packet size 1472 in egress EDNS(0) packet.
systemd-resolved[153542]: Emitting UDP, link MTU is 1500, socket MTU is 0, minimal MTU is 40
systemd-resolved[153542]: Sending query packet with id 4147 of size 47.
Activity
pemensik commentedon Jun 11, 2022
Fedora has
myhostnamenss plugin enabled in /etc/nsswitch.conf. That might get automatically response to hostname query. Try havinghosts: files myhostnamein that configuration file. It makes sure local hostname maps to local addresses. But I am not sure it will apply also searchdomain, if hostname does not contain FQDN.resolved: make resolved authoritative in resolveing our local host name