Crow by Patrick Wilken

Frigtarded Leopard DNS issue

Crafted in California by Tim Trueman   (Thu Feb 28 00:00:00 -0800 2008)
Audi R8

So ever since Leopard shipped in October, I've had serious problems with using the Internet. I had just moved to Silicon Valley and the process of new OS, new ISP, and a new router complicated tracking down the issue. Let me assure you, AT&T is by no means a reliable (or fast or cheap) service. Their Uverse service requires you to use their 2Wire "residential gateway". I've got no nice things to say about 2Wire but this time I think the ultimate blame goes to Leopard.

I'll be the first to admit Apple probably let this one slip through their QA process and that I'm kind of disappointed (perhaps even upset). The problem lies in a newly implemented Request For Comments (RFC), numero 2308. This RFC outlines "Negative Caching of DNS Queries". Negative caching of DNS queries is a proposal for a way to speed up the user's experience when network problems arise. Instead of waiting for a timeout to occur, the negative cache resolves near-instantaneously and lets the request know that it's not going to work. Brilliant idea…right?

Not so fast. Remember my shitty Internet connection? AT&T's DNS servers are spotty at best and from time to time a lookup will take longer than expected, timing out and creating a negative cache entry. For the next hour. Even though I could perform the look up again and this time it would work, the negative cache entry stops the second lookup from ever happening. So that's it, I'm hosed right? Nope, Apple has provided a handy command-line application that can manage these negative cache entries. It's called dscacheutil and it can "gather information, statistics and initiate queries to the Directory Service cache". For instance to see if there are any negative cache entries run this command:

dscacheutil -cachedump -entries

There's a column labelled "Neg" and if you see a "YES" then you may be able to solve your problems by flushing the cache manually (instead of waiting an hour):

dscacheutil -flushcache

Thanks to this discussion on Apple's support website for helping me out! Now I just want Apple, AT&T, and 2Wire to take note and nip this one in the bud.

Tell me if you've had this problem or another similar one!

fin

Subscribe Say hi@timtrueman.com