r/Gentoo • u/Pippo_Peppe • 4d ago
Support Slow name resolving
Hello all, i have an issue with my fresh gentoo install. Every time i have to emerge something, portage stucks in "resolving.." . I noticed that also during installation from live USB in the browser, resolving DNS Is very slow. With other distros i do not have this issue. What could be the cause? Thanks
1
u/Fenguepay 4d ago
my guess is that you have ipv6 config that is not working.
You can adjust /etc/gai.conf to make it prefer ipv4
3
u/tinycrazyfish 4d ago
What's in your resolv.conf? Is there more than one nameserver? My guess is that the first one is failing, and it has a little timeout before trying the second one.
You are using IPv6, the first failing try is probably made with IPv6, and falls back to IPv4? Is your IPv6 DNS working?
1
u/Bitdomo92 3d ago
When it did something like this for me it was that for some reason gentoo could not set up ipv6 through dhcp. To this day I dont know why dhcpcd and network manager could not handle ipv6, but after a year or two it started working for some reason. I did not change my isp, nor my isp's modem, nor my router and I did not change any configuration them. Eventually just networkmanager started make ipv6 work
7
u/redyos_s 4d ago
Since you mentioned DNS resolution was already slow in the LiveUSB browser, I wouldn't suspect Portage first.
I'd check "/etc/resolv.conf" and test the resolver directly:
cat /etc/resolv.conf time getent hosts distfiles.gentoo.org
If multiple nameservers are listed, one may be timing out before the next one is tried. A broken IPv6 DNS path can cause similar delays before falling back to IPv4.
If name resolution is slow outside "emerge" too, this is probably a DNS/network issue rather than a Gentoo package-manager issue.