How to disable AAAA queries for IPv6 / configure your resolver

Today I stumbled upon a very nasty behaviour of glibc – again.

On a host which has no access to IPv6 at all and no module-support in the kernel,
it seems the connect() call fails when there is a AAAA record in place for a remote server.

This means I cannot wget a webpage if an AAAA record exists for the page, etc.

You will find many solutions on how to ‚disable IPv6‘ – but they all miss the resolver in glibc, the part that is behind the ‚gethostbyname‘ call.

I like to disable AAAA DNS-queries for IPv6 completely – and the solution is easy:

#cat /etc/resolv.conf 
options no-inet6
nameserver ...
nameserver ...

Just documenting it here, because the manpage does not document the ’no‘-Feature and searching for this on google was not helpful at all.

Dieser Beitrag wurde unter bugs, en, leid, Linux, Technik, Tipps veröffentlicht. Setze ein Lesezeichen auf den Permalink.