You are not logged in.
For some domains on my network, both `getent hosts` and browser resolution (`gethostbyname` I suppose) are super slow (10+ second) when I'm using 8.8.8.8 (this doesn't happen on OpenDNS). However, `dig` takes only several hundred ms, even though they're supposedly querying from the same DNS server.
How do I start to diagnose?
Last edited by hyou (2019-12-05 06:00:35)
Offline
dig doesn't use nsswitch, so esp. because of "domains on my network" it's one of the other confiured resolvers.
Also: do you use systemd-resolved?
Offline
Sorry my wording was a bit confusing. I meant when I'm connected to this particular network and querying this particular (public) domain, it is slow with `getent hosts` and gethostbyname.
I'm using systemd-resolvd.
Offline
You could
strace getent hosts google.com
to see where it hangs.
Wild guess: IPv4 ./. IPv6 thing?
Offline
Sorry to bump an old topic, but Google found this readily. I'm having the same lag problem with `getent hosts` resolving public IP addresses back to hostnames. If they're supposed to return NXDOMAIN, the resolver gets hung up for 5 seconds, each time.
strace shows the hang is entirely on waiting for Avahi to respond with a result.
For example, for resolving the reverse of the current kode54.net, my hosted domain:
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl(3, F_GETFL) = 0x2 (flags O_RDWR)
newfstatat(3, "", {st_mode=S_IFSOCK|0777, st_size=0, ...}, AT_EMPTY_PATH) = 0
write(3, "RESOLVE-ADDRESS <public IP>\n", 30) = 30
read(3, "
5 second hang with cursor on the end of that line, then emitting the rest below:
-15 Timeout reached\n", 4096) = 20
close(3) = 0
Further edit: It seems it was because something had convinced me to setting full `mdns` in nsswitch.conf instead of `mdns_minimal`.
Last edited by kode54 (2023-09-30 08:21:35)
Offline
Convinced by https://wiki.archlinux.org/title/Avahi# … om_working ?
Is resolved getting in the way/responding atm at all?
Offline