TL;DR: Set up your computer to ignore your router's DNS proxy and instead use another DNS server. Try your ISP's DNS server or use a public DNS server like Google's.
You're using a Mac. You can override your DNS server by:
- going to the Network control panel
- clicking Advanced…
- choosing DNS and entering the new server addresses, e.g.
If you only want to use these DNS servers on your home network then create a new Location in the Network control panel.
I had a similar problem. For me, it was intermittent errors with
*.imgur.com and also, ironically, with
*.sstatic.com, the site used to server Super User's static content. Lookups would fail for a while, then work for a while, then fail again.
I had recently upgraded my router, so it seemed to be something to do with that.
dig I tested queries against different DNS servers:
- Queries to my router would fail intermittently. My router proxies my ISP's DNS servers.
- Direct queries my ISP's DNS servers would fail intermittently too. Direct queries always worked with my last modem.
- Direct queries to Google's Public DNS servers worked all the time.
So maybe my router was messing up DNS responses from ISPs servers (both proxied and direct). Or maybe the ISPs servers were failing intermittently? It was hard to tell, and I didn't bother working out which was the real problem. :)
The queries that were failing were for Content Delivery Networks. That makes sense, in a way, because CDNs often return complex DNS results to optimise performance.
Like me, you might have a problem with your router's DNS, with your ISP's DNS or with some interaction between the two. Here are possible solutions.
- Configure your devices to use another DNS server. Either use your ISPs DNS server directly or use a public DNS server such as the one Google provides.
- Edit the
/etc/hosts file on your devices and manually add addresses for failing lookups.
- Set up your own DNS server internally.
Option 1 is the easiest. I recommend it if you're based in a location that has a local public DNS server. Here are the locations of Google's public DNS servers.
I'm in I'm in New Zealand, and I didn't want to go with a public DNS server in another country. Doing so would mean higher latency for me on every DNS lookup. It would also lessen one of the main benefits of CDNs. CDNs try to serve content from local servers if possible, and they do this based on the location of the DNS server. A US- or Asia-based DNS server would have lessened this benefit.
I also didn't want to want to use my ISP's DNS servers, since they were flaky when my router was involved, even for direct queries.
So option 2 was a bit better for me. It will mean a bit of maintenance, but I'm happy to use
dig and edit