DNS resolution under Chrome/Firefox taking a whole second longer than Safari

188 Views Asked by At

Short: I'm trying to figure out the underlying difference in how Chrome and Firefox do a DNS lookup on macOS vs how Safari does it.

Detail: I have an HTML page that does an AJAX request to a randomly generated (GUID-based) hostname on my server. When loading the page in Chrome or Firefox, the ResourceTiming object shows that the DNS resolution takes a whole second longer (roughly 1000ms) than it does in Safari.

More detail: Whatever is causing this, it's only happening on this specific instance of macOS. Even a virtual machine instance running on this same laptop doesn't have the problem.

Output when accessed from Chrome:

Retrieved: https://4-7-8a0e8a44-5a51-461f-8f89-36ca7130c503.lax-ns8ds.com

{
    "domainlookupstart_domainlookupend": 1234.699999971781,
    "connectstart_connectend": 48.79999998956919,
    "sslstart_connectend": 29.700000013690442,
    "responsestart_responseend": 0.7999999797903001,
    "fetchstart_responseend": 1308.000000019092,
    "requeststart_responseend": 22.200000006705523,
    "starttime_responseend": 1308.000000019092
}

and when accessed from Safari:

Retrieved: https://4-7-2ca9fb3f-f43d-4797-8745-cd11d20483af.lax-ns8ds.com

{
    "domainlookupstart_domainlookupend": 216,
    "connectstart_connectend": 113,
    "sslstart_connectend": 69.99999999999994,
    "responsestart_responseend": 1,
    "fetchstart_responseend": 358.0000000000001,
    "requeststart_responseend": 28.000000000000114,
    "starttime_responseend": 358.0000000000001
}

Obviously, the other timings vary on their own, but the domainlookup portion of the ResourceTiming is what is consistenly off by ~1000ms.

It feels like there is some sort of timeout happening internally, but I'm not sure and I don't really know how to dig deeper.

The test HTML page is set up at https://lax-ns8ds.com/wtf.html, though running it yourself likely won't show anything (as I don't see it myself on any other machine or VM instance of my own).

Last detail I can think of: I tried using dtruss to see if I could see a difference in the system calls being made that would give me a hint as to the difference between Chrome and Safari, but that didn't get very far.

0

There are 0 best solutions below