Fedora 39 WS dns peculiarities

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:

repo.maven.apache.org: resolve call failed: Lookup failed due to system error: Invalid argument

I believe at this point Java just gives up (as underlying lib throws error) and do not retry. What could be the source of this sporadic error?

After some digging came to this commit:

As same thing happens here as in related issue (but CDN is Fastly).

Seems problem is fixed in Systemd 255, but F39 is still on 254…

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.

Thanks for the tips!

In fact, it was dig that helped me figure out what is happening, and to get to Github commit and related issues. Where do I file bugs for backporting systemd fixes?

And yes, Java (on linux) uses getaddrinfo(3)

Created 2263890 – Sporadic DNS lookup failure of repo.maven.apache.org due Systemd-resolved bug

1 Like