I'm hitting an error where after changing a DNS name, dig reports that a name resolves to the correct IP but curl says the name doesn't exist. Restarting the machine clears the problem, clearing the DNS cache fixes the problem too.

It's become clear that Mac is caching NXDOMAIN responses too aggressively.

I've Googled for ways of getting it to not cache NXDOMAIN but it's just become more and more clear the more I search that there isn't a way to do that, and that this problem has existed in one form other another on Mac for many years and many versions of MacOS.

At this point I just want to turn off Mac DNS caching entirely since they clearly aren't fixing the problem.

How do you disable/bypass the mac DNS resolver? I'm looking to do this for the whole system, not just for specific applications. Thanks in advance!

  • Why is it you think that macOS caches NXDOMAIN responses too aggressively? - They are meant to be cached, and the amount of time they're cached is specified by the authoritative DNS server (i.e. not the macOS client). If you want it do NOT cache NXDOMAIN at all, that would be non-standard. Can you link to any resources that indicate that there's a bug of some sort in the macOS implementation? – jksoegaard Apr 5 '19 at 20:59

You must log in to answer this question.

Browse other questions tagged .