Aapeli Vuorinen

CloudFlare to the rescue

I run a bunch of services reverse proxied through nginx, and for some reason they’ve been horrendously slow lately. For instance, my GitLab server would sometimes take over 5 seconds to load!

Today I finally got around to investigating this issue, and using Firefox’s Developer Tools, specifically the response timing info, I realised that even just the DNS queries were taking over 500 ms! Turns out that Namecheap sets “DynamicDNS” TTLs very low, and it was fetching the DNS info essentially every time I was visiting my websites; in addition to this, it turns out that Namecheap has atrociously slow DNS servers in Australia, so I went out to look for an alternative.

I never really came to think about DNS as an important factor; I just somehow assumed that the queries would be almost instant and that they would be cached for a long time, but, alas, I was proven wrong! After upgrading to the free tier CloudFlare DNS, the DNS resolution time dropped considerably.

I also wrote a quick Python client to update my DNS records, and it works like a treat!