KExtendedSocket async lookup
thiagom at wanadoo.fr
Thu Aug 1 20:00:11 BST 2002
-----BEGIN PGP SIGNED MESSAGE-----
Waldo Bastian wrote:
>After looking into the KExtendedSocket code I noticed that async lookups use
>the QDns class. Doesn't this imply that the lookup results for sync and
>asynced mode operation can vary wildly since QDns does not take into account
>/etc/hosts among others?
That could be a problem, yes. But I could find no other way of doing an
asynchronous lookup without using the undocumented, GNU-specific
I had planned on writing a resolver library that would do all that and also
implement SVR-based lookups, but I simply can't find the time.
Do you have any other suggestions?
>Related to this differences, netsupp.cpp has a test for the availability of
>IPv6 but the async lookup code does not seem to check that and do a IPv6
>lookup in all cases.
Hmm... true. It would be then useful to make the same tests and decide whether
to do an IPv6 lookup or not.
>As of last year there were still a lot of nameservers out there that don't
>properly handle IPv6 lookups (bbc.co.uk the most well known) so not being
>able to disable IPv6 lookups is a problem. (See e.g. BR30078)
The thing is, either we do it right or we work around those buggy servers. The
idea behind getaddrinfo() is that we don't have to know what kind of
addresses we're looking for. So, it will do IPv4, IPv6 and Unix lookups as of
now and, maybe in the future, some new things. That we accomplish by using
Now, to work around those buggy servers -- disabling IPv6 lookups -- we would
have to give up our ignorance of the socket type and force an IPv4 lookup.
That means we lose v6 (which is the intention) and also anything else that
getaddrinfo might want to give us, like Unix sockets.
The code in kde_getaddrinfo() (netsupp.cpp) is already a mess. I can't
understand most of it any longer, which is a reason why I wanted to rewrite
the lookup code.
Anyways, luckily for us, it seems that bbc.net.uk (which is where bbc.co.uk
domains seem to be pointing) is running a decent DNS server now, that answers
correctly to IPv6 queries(*)
Besides, IPv6 lookups aren't a new thing. They've been around since December
1995 (RFC 1886). You'd think that DNS servers would have been updated since
then... I don't even want to know what will happen when A6, DNAME and
bit-field DNS lookups become common.
(*) even though it still seems to have an odd behaviour, compared to BIND.
Thiago Macieira - UFOT Registry number: 1001
thiagom at mail.com
ICQ UIN: 1967141 PGP/GPG: 0x6EF45358
Registered Linux user #65028
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the kde-core-devel