Howdy, I use plain PC w/ F39 WS (up to date), nothing tinkered, just “default install” as Fedora installed it (w/ defaults, Wayland + Gnome). I do Java most of the time on this box. Many times I have build failures (as Java reports) due DNS lookup failures. When I restart the build, sometimes the errors are gone, sometimes not.
Tried to reproduce it and seems I got it:
Another blip (dns cached, but then “cached network” happens):
See line 30: sporadically, but sometimes I get this error. For example to produce this gist all I did is just “looping” with this command… and from time to time, I get that:
It would have helped, if you used dig repo.maven.apache.org command. That shows also TTL remaining in the cache and might became obvious, that it fails when TTL becomes close to zero. Ie. on refresh only.
Please create a bug requesting backport of the fix to f39 and f38 of this issue, if this indeed fixes the issue. Not many systemd-resolved fixes were backported recently, but without a bug for them they won’t be.
Give a try using dnsmasq instead. Just create snippet file by sudoedit /etc/NetworkManager/conf.d/dns.conf. Put there:
Save, then sudo rm -f /etc/resolv.conf && sudo systemctl restart NetworkManager. You can then even sudo systemctl disable --now systemd-resolved, as it won’t be used anymore.
It has not so nice interface, but behaves a bit more consistently in terms of DNS protocol. Because it does not mix multiple protocols, it may work better. Might behave better to you.
I am not sure whether Java reuses getaddrinfo() calls from glibc or it does have own DNS stub implementation and just reads /etc/resolv.conf file for server addresses.