Re: DNS caching(?) page-hangup issues and Opera 10.X
Eirik Byrkjeflot Anonsen <[email protected]> Mon, 05 Jul 2010 07:40:04 +0200
| Newsgroups | gmane.comp.web.opera.linux |
|---|---|
| Message-ID | <[email protected]> |
Kenneth Crudup <[email protected]> writes: > I'm using the latest X64 build (which I guess is now 10.60), but for a > long time now Opera always hangs up resolving hostnames every time I > switch networks on my laptop. > > It's apparently trying to cache the previous DNS server; eventually it > must be uncaching what it knows, as after a while I don't get hung up > on "looking up hostname _____" (and since the page-loading timeout is > less than the DNS resolution timeout, many times pages just stop loading > over DNS issues). It hangs on DNS lookups? That's odd. I doubt very much that we are caching DNS server addresses, as we should not do DNS lookups ourselves. We should be using the C library's DNS lookup functions (e.g. gethostbyname, getaddrinfo). Assuming that this is true, and that your observations are correct, the obvious conclusion would be that the C library is where the problem is. If that is true, it should be possible to test with a simple test program. > Is there any setting I can use to either flush DNS or stop it from > caching DNS? I'd much rather prefer to use my local caching server on > 127.1 anyway. And you are sure it isn't this caching server that caches which DNS server it is using? Here's a test program, which looks up each name in turn. Run it (on a set of names which are not cached on your system...), wait for the first lookup to be done (to be sure the C library has properly initialized the DNS subsystem) and then switch network and see if the same problem occurs. (You may want to change the "sleep" parameter if 10 seconds between each lookup isn't to your liking. Also, this is using the classic but now obsolete "gethostbyname". I don't know exactly what opera is doing these days. But probably it ends up doing the same thing internally anyway.) eirik #include <netdb.h> #include <stdio.h> #include <unistd.h> int main(int argc, char ** argv) { if (argc < 2) { fprintf(stderr, "usage: lookuphostloop <hostname> <hostname>...\n"); return 1; }; for (int hostnum = 1; hostnum < argc; hostnum ++) { if (hostnum > 1) sleep(10); char * hostname = argv[hostnum]; printf("Looking up %s ... ", hostname); struct hostent * he = gethostbyname(hostname); if (he == 0) { printf("error\n"); } else if (he->h_addr_list[0] == 0) { printf("none\n"); } else { for (int i = 0; i < he->h_length; i++) { if (i != 0) printf("."); printf("%d", ((unsigned char *)(he->h_addr_list[0]))[i]); }; printf("\n"); }; }; return 0; }; -- Opera-Linux: https://list.opera.com/mailman/listinfo/opera-linux More lists: https://list.opera.com/mailman/listinfo/ Unsubscribe: mailto:[email protected]?subject=unsubscribe