[Qt-interest] DNS caching in Qt

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Wed Jul 6 13:22:39 CEST 2011


> Please check if the DNS server is at fault. Many years ago, we had a very ugly
> problem with a faulty firmware in a very popular CPE router in Germany and the
> manufacturer refused to fix. Later, when Safari was affected by the same
> problem, they finally fixed it.

Ok...any pointers as to what to look for specifically which might
point to a fault in the server?

>
>> * Are DNS lookup failures cached too or only successful resolutions cached?
>
> I don't see anything in the code that would indicate that negative results are
> treated specially. So I guess they are cached.

Well, there can be 2 kind of lookup failures in the scenario I mentioned.

1. The DNS itself was not reachable (maybe the routes were not setup by NM yet)
2. The DNS responds, but with a lookup failure.

I think the cache would be updated only on (2), right? The DNS not
being reachable should not alter the cache in any way.


> I can't find the code to do that either.

This was the bug report that I read:
http://bugreports.qt.nokia.com/browse/QTBUG-12814

I had read your comment, where you point out that DNS cache is flushed
if resolv.conf is modified! :)

>
> Can you try to touch /etc/resolv.conf when the application isn't finding the
> hostname and check if it changes behaviour?

Yes. I did that after reading your comment on that bug report. I just
'touch'ed the file...lookup was still failing. Only way to recover is
to wait for some time before making a request.

> If it doesn't, please file a bug report.

Can I? Because I'm using Qt 4.6.2 on embedded Linux (that won't be
supported right?).

We have got a patched version of Qt from our h/w vendor (the patch
applies over the open source version of 4.6.2). I have inspected the
patch and they have not touched anything related to networking. So I
guess this behavior is in the open source version of 4.6.2.

I'll see if I can replicate this issue with 4.7.3 on a Linux desktop
and then probably report a bug if needed.

Regards,
-mandeep



More information about the Qt-interest-old mailing list