Bug 138906 - Konqueror tries to resolve the same domain name multiple times
Summary: Konqueror tries to resolve the same domain name multiple times
Status: RESOLVED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords: investigated, triaged
Depends on:
Blocks:
 
Reported: 2006-12-17 09:43 UTC by Dima Ryazanov
Modified: 2018-10-21 05:24 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Ryazanov 2006-12-17 09:43:36 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 4.1.1 (Gentoo 4.1.1-r1) 
OS:                Linux

When I open a page with multiple images or other objects, Konqueror seems to send a DNS request for every single image - even if the domain names are all the same. (At least, that's what the output of Ethereal looks like.)

If I try to go to http://gaim.sourceforge.net/planet/ , Konqueror sends too many DNS requests, and doesn't receive responses for half of them - so the page takes forever to load, and half of the images (or CSS files, etc.) don't show up.

If I open the same page in Firefox, it loads very quickly, with all images present. It doesn't send the same DNS queries over and over again.
Comment 1 Bram Schoenmakers 2006-12-17 12:07:29 UTC
Can not reproduce.
Comment 2 Tommi Tervo 2006-12-18 10:02:53 UTC
Dima, please read following thread http://lists.kde.org/?l=kfm-devel&m=116544205906394&w=2
Comment 3 Dima Ryazanov 2006-12-18 21:06:44 UTC
Ok... nscd fixed it for me.
Comment 4 Dima Ryazanov 2007-12-28 07:26:14 UTC
Actually, nevermind - nscd helps, but doesn't fix everything. For some reason, it doesn't cache domain names that resolve to multiple IP addresses - like google.com. So if I use e.g. maps.google.com, Konqueror almost never loads all of the images.

I tried this in Ubuntu and Gentoo. Neither one uses nscd by default, by the way. I'm kind of surprised that other people are not running into this problem. Ok, maybe it's not Konqueror's fault - but the fact is, Konqueror just fails to load lots of websites for such a silly reason.
Comment 5 Dima Ryazanov 2008-01-06 06:43:14 UTC
I just wrote a simple C program that resolves host names using getaddrinfo - and all queries get cached as expected - no duplicate DNS requests.

So... What does Konqueror (and the rest of KDE) do then? Does it no use getaddrinfo? Why not?
I just tried this in Gentoo, Ubuntu Gutsy, and KDE4 compiled from sources - in all cases, Konqueror sends the same DNS requests over and over.

If you don't have this problem, could you please tell me what distribution you use? I would *really* like to know.
Comment 6 Dima Ryazanov 2008-01-06 07:06:25 UTC
Oh, same for Fedora 8.

Btw, from /etc/nscd.conf on Ubuntu:
# hosts caching is broken with gethostby* calls, hence is now disabled
# per default.  See /usr/share/doc/nscd/NEWS.Debian.

KDE wouldn't be using any of those calls, would it?
Comment 7 Dima Ryazanov 2008-01-07 04:19:25 UTC
I found a simple test case:

#include <kresolver.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
  if (argc != 2) {
    fprintf(stderr, "Usage: %s host\n", argv[0]);
    return 1;
  }
  
  KNetwork::KResolver qres(argv[1]);
  qres.setFamily(KNetwork::KResolver::InternetFamily);
  qres.start();
  qres.wait();

  return 0;
}

Run it with an argument like "google.com", and it will send a DNS request every time.

But, if you change InternetFamily into AnyFamily, it starts using the nscd cache. For some reason, though, if you compile it using KDE4 (and replace kresolver.h with k3resolver.h), then AnyFamily will cause it to abort.

This is not specific to KDE, apparently. You get the same thing by running this:

struct addrinfo hint = {0};
hint.ai_family = PF_INET;
int status = getaddrinfo(argv[1], NULL, &hint, &result);

It doesn't use the cache. But replace PF_INET with 0, and it will.

So... What does this all mean? Whose bug is this?
Comment 8 Maksim Orlovich 2009-02-05 00:53:42 UTC
recent kdelibs has a DNS cache, which hopefully has resolved this issue...?
Comment 9 FiNeX 2010-08-02 21:24:57 UTC
What is the current situation?
Comment 10 Andrew Crouthamel 2018-09-20 22:00:12 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Andrew Crouthamel 2018-10-21 05:24:32 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!