Mac OS X Local DNS Caching
Mac OS X still amazes me. It gives me an awesome desktop environment with a Unix core. Most of the time OS X is well behaved with standard protocols, in part due to its Unix core. However, I discovered one badly behaved OS X daemon called lookupd
and wanted to warn others. lookupd
does lots of things. One of them is caching host names and IP addresses. On paper, this sounds great. It’ll reduce DNS overhead and could even increase responsiveness. Unfortunately, it doesn’t work when an IP address actually changes. You see, the DNS protocol has built in support for dealing with distributed caches. Unfortunately, Apple decided to ignore this and caches the IP address forever, ignoring the server-assigned time to live (TTL). The symptom is a server name that keeps getting resolved to an old address, even after all DNS servers report a newer addres. It’ll never expire until lookupd
gets restarted. Apparently, Apple even has a program to do this, and it worked like a charm. Too bad all Apple had to do was keep track of the TTL, and restarting lookupd
would be unnecessary.