· engineering  · 3 min read

DNS Troubleshooting

A few simple steps to take, if you're having unexpected issues with your DNS changes.

A few simple steps to take, if you're having unexpected issues with your DNS changes.

Troubleshooting DNS issues can sometimes be difficult, there are multiple servers and caches between your device and the final resolution of the domain.
Before updated DNS entries are generally available, the changes need to have replaced any cached data on any point of the journey.
This delayed updating, and cache replacement process is called “propagation”.

Techniques to help troubleshoot DNS issues

  1. Check for Typos:
    The most common issue, aside from waiting on propagation, is simply typos - DNS values can be pretty complex sometimes, it’s easy to miss characters, particularly text separators. Another source of confusion and error can be that the value for records is often displayed in double quotation marks in the nameserver UI, which can be accidentally copied into the value - this is often the case with TXT records.

  2. Patience:
    We should still allow 24-48 hours for changes to propagate, and extreme cases up to 72 hrs - in the old days it really did take this long, but as nowadays changes become available much quicker, often within minutes or hours, we can be surprised when propagation is slow.
    We can exercise a certain amount of control by setting a low time-to-live (TTL) on records, to indicate how long they should be cached.
    But often, simply waiting can resolve issues.

  3. Flushing DNS caches:
    Your device caches DNS records it’s looked up, so be sure to flush your DNS cache if you’re not seeing the changes you expect.
    On Windows, open command prompt as administrator and type:

    ipconfig /flushdns

    On Mac, enter the following into your terminal:

    dscacheutil -flushcache

    Some places will recommend sudo killall -HUP mDNSResponder for Mac. This has a similar effect, but in a less targeted way, by restarting mDNSResponder.

    With Linux, the process can vary depending on your setup, there’s a good guide here

    Your browser can also cache DNS records, so you may need to clear that too, methods vary of course between browsers. For example, in Chrome, navigate to chrome://net-internals/#dns and click Clear host cache.

    DNS records can be cached all over the place, for example on your ISP and maybe even the router on your local network. If you’ve tried the above, and you’re still not seeing the changes you expect, try connecting to a different network (mobile phone networks tend to be quite good for this).

  4. Online Tools:
    There are various online tools available for checking DNS record propagation, two I use frequently are:

    • dnschecker.org - a useful, easy to use tool, simply enter the domain, record type and optionally the expected value for the record. Clicking search will then perform a lookup from a number of distinct geographical locations, showing which have sccesfully propogated.
    • mxtoolbox.com - less visually appealing, but with more advanced options, mxtoolbox allows you to verify and validate pretty much any record in your DNS.
  5. Command line: On Linux or Mac we can use the tool dig to lookup and query DNS records. The basic snytax is:

     dig [server] [name] [type]

    There are many options, and covering the use of digis beyond the scope of this article, a more complete guide can be found here.
    Windows users can perform similar queries and lookups using `nslookup, for example:

    nslookup google.com

Conclusion

The vast majority of the time, the errors you’ll encounter using DNS will boil down to either typos, or a failure to propagate.
There are many tools at your disposal to investigate this further, depending on your operating system, but patience is always necessary, and clearing any caches should be your first step.

James Babington

About James Babington

A cloud architect and engineer with a wealth of experience across AWS, web development, and security, James enjoys writing about the technical challenges and solutions he's encountered, but most of all he loves it when a plan comes together and it all just works.

Comments

No comments yet. Be the first to comment!

Leave a Comment

Check this box if you don't want your comment to be displayed publicly.

Back to Blog

Related Posts

View All Posts »