Closed Bug 94079 Opened 18 years ago Closed 18 years ago

PAC: too many DNS lookups


(Core :: Networking, defect, major)

Not set





(Reporter: Austin_Donnelly, Assigned: neeti)



(3 files)

Mozilla version 0.9.3 (Build ID: 2001080104)

If preferences Advanced/Proxies is set to "Automatic proxy configuration URL"
then when loading I see around 34 extraneous DNS lookups
happen. This happens within a 3 second period.

My guess is that mozilla doing a DNS lookup for each subcomponent of the page it
has just loaded, despite the fact mozilla should leave that to the proxy.

I'm getting my auto proxy config from

This file reads:

function FindProxyForURL(url, host)
   if(  shExpMatch( url, "*cgi*" ) ||
        shExpMatch( url, "snews:*" ) ||
        shExpMatch( url, "https:*" ) ||
        dnsDomainIs( host, "") ||
        dnsDomainIs( host, "cam") ||
        dnsDomainIs( host, "ac") ||
        dnsDomainIs( host, "" ) ||
        dnsDomainIs( host, "" ) ||
        dnsDomainIs( host, "" ) ||
        dnsDomainIs( host, "" ) ||
        dnsDomainIs( host, "localhost" ) ||
        isPlainHostName( host ) ||
        isInNet( host, "", "") ||
        isInNet( host, "", "") ||
        isInNet( host, "", "") ||
        isInNet( host, "", "") ||
        isInNet( host, "",   "") )
        return "DIRECT";
   else return  "PROXY; " +

If I change the proxy preferences setting to "Direct connecton to the Internet"
"Manual proxy configuration" (with just an HTTP proxy set to
port 8080) then I see correct DNS behaviour: a single lookup
request is sent (and presumably the result cached by mozilla).

This will probably end up as a dupe of bug 93845.
i've been seeing a very noticeable performance hit because of this. as of
2001090608, this is still a major problem.
What sites are being looked up? isInNet will cause a lookup, but that should
only happen once per host now that the last host looked up by PAC is cached.

Can you attach a full packettrace, inclusing dns requests, loading from a new browser session (after clearing the cache), then
reloading it?
Attached file packet trace A
Attached file packet trace B
Attached file packet trace C
As requested, I've attached 3 packets traces.

This is all still with build ID 200108104 Linux ix86.

I turned on PAC, cleared my disc and memory caches and quit the browser.

I ran
   tcpdump -s2048 host or port domain
I then started mozilla and clicked on a link to 
from my homepage (which happens to be local). Packet trace A shows what
happened.  The page loaded and displayed correctly.
I then clicked on the refresh button.  Packet trace B shows this.  Again
the page loaded fine.

I then shift-clicked refresh, and captured Packet trace C.
The packet traces are cut and pasted from the tcpdump output - one tcpdump
was running all through this, and all packets are present either in
trace A, B, or C.  I stopped the tcpdump some 30 seconds after the last
shift-reload experiment.  I note that no FIN packets were exchanged between
my local machine hornet and the cache (   resolv0 is my
local DNS server.
Hope this helps!

Hmm. Is this still occuring with later nightlies? may be having 
a different problem.
I've just downloaded a nightly build, ID 2001090906, and tried to repeat
this bug.

As far as I can see, it is fixed.  Loading causes only
one DNS lookup of  Reloading or shift+reloading doesn't
cause any further DNS lookups.
I am assuming the single initial DNS lookup is part of trying to figure out
if the user typed a valid hostname before trying to add "www." to the start,
or ".com" to the end.  This may well be a separate bug, but as far as I am
concerned this particular bug has been fixed.

I've marked this bug resolved as FIXED.
Thanks guys!

Closed: 18 years ago
Resolution: --- → FIXED
No, its used for the IsInNet call in the pac file - we need the IP to fix that.
QA Contact: benc → pacqa
Summary: Waaay too many DNS lookups when Automatic proxy configuration set → PAC: too many DNS lookups
You need to log in before you can comment on or make changes to this bug.