- Newest
- Most votes
- Most comments
So there were a couple of things I did to resolve this. First, I flushed the DNS cache on my Macbook Pro with the following command in a terminal session:
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
For good measure, I cleared the web cache on all my browsers and restarted the laptop as well. The big clue that pointed me in this direction was the site working on another computer that hadn't previously been used to view it. This suggested it was an issue with the laptop itself. Make sure to give the DNS cache some time to clear (a few minutes should be more than sufficient).
Another thing I had overlooked was creating A record aliases to the CloudFront distribution - I had only created AAAA records (which are recommended by Amazon). In my case, it was tricky to diagnose the problem because I hotspot off a mobile phone. Most of the time I'm allocated an IPv6 address so the site looked fine. However, it would randomly stop responding to browser requests - I suspect on those occasions the PC was allocated an IPv4 address and was looking for an A record instead of an AAAA. Why do I think this? I asked friends to check out my site and they DIDN'T see it first go - so DNS caching on their machines was not the issue.
Moral of the story: create BOTH A and AAAA alias records. IPv4 is going to be around for a long while yet and you simply can't predict what type of record your audience will request. If you're stuck getting bad responses and dig doesn't report errors, flush BOTH the web and DNS caches as well.
Hope someone else finds this useful.
Cheers, Flic
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago