Website Changes: New Domains, New Infrastructure
I haven’t posted in a while now, but nevertheless, I have been working on this site. Perhaps I have been too bogged down in the minor details, but it was a relatively interesting experience nonetheless.
You may have already noticed some differences:
- The most obvious change is probably the domain. Instead of
using my old
quantum2.xyz
domain, I switched to the shiny newquantum5.ca
. - The second most obvious change is the short URL on every post.
- The last change is invisible: the backend is now distributed in three locations around the world. This is so that even if you are in faraway Australia, you can still load this website instantly, even if it’s not in the Cloudflare cache.
Why did I make these changes? Well, this was because I became thoroughly nerd-sniped by some ideas…
The Domain
The domain thing actually started because I wanted a quantum
domain without a
number in it. Funny how eventually I ended up with quantum5.ca
…
So basically, I scoured the Internet and found that quantum.gdn
was
available for registration. I bought the domain, intending to move the site
over there. However, I was immediately greeted with some problems:
- The
.gdn
registry does not appear to be well-maintained. I think this is something people frequently overlook as they try to find the ideal domain.1 My main problem with this registry is that it doesn’t support DNSSEC algorithm13
, which is ECDSA Curve P-256 with SHA-256. This is the only algorithm that Cloudflare supports, but it should be pretty widely available. Unfortunately, the.gdn
registry is stuck in the past, and using it would mean giving up DNSSEC. In the grand scheme of things, it’s not that big of a deal, but it doesn’t inspire confidence. - I asked a few friends of mine whether they are more likely to remember
quantum2.xyz
orquantum.gdn
. Perhaps unsurprisingly, none of them has ever heard of.gdn
and all found.xyz
easier to remember, even though there was a number.
Well, I guess the second reason is the real reason I didn’t use the .gdn
domain. And so quantum2.xyz
remained safe, for the time being.
But then something else happened: I was invited into the Cloudflare Email Routing Beta. It worked great, and I am now using it to handle email reception on all my domains. However, I took the opportunity to evaluate my entire email setup. This is when I delved too deep. Fortunately, I did not awake a creature of shadow and flame.
Unfortunately, though, I discovered that because .xyz
domains are heavily
discounted in the first year, it was used for a ton of spam. Common anti-spam
solutions mark all emails originating from .xyz
domains as suspicious, e.g.
SpamAssassin. While writing this post, I discovered a Hacker News
thread that showed the situation was much worse than I thought. So naturally,
I looked elsewhere.
Now, wait a second, why didn’t I just use quantum.gdn
? That would be because
it was also too spammy. With that idea sunk, I turned to look at
trustworthy top-level domains (TLD). As a Canadian, the one that naturally comes
to mind, and the one that I have the strongest ties to, is naturally .ca
.2
Unfortunately, quantum.ca
was taken. However, quantum5.ca
was not. Since I
use the username quantum5
a lot, e.g. on GitHub, I decided to get that
instead. After all, if I am going to use numbers, I might as well use the same
numbers.
And thus I created my new email address [email protected]
. For consistency, and
due to the general suspicion surrounding the .xyz
TLD, I decided to move my
website too.
And there we have it. I switched the domain name for this website because I looked too deeply into my email setup.
The URL Shortener
So where did the URL shortener come from? Well, it all happened when I was
looking at various registries. I discovered that the little-known Åland
Islands — a Swedish-speaking autonomous region of Finland — has its own
TLD .ax
. Since it was not well-known, some 2-character domains under it are
still available, with one of them being qt.ax
. Naturally, I was sniped by the
potential of creating my very own URL shortener and spent €32 buying the domain.
Of course, now that I have the domain, I needed to actually create the URL shortener. Naturally, I researched self-hosted URL shortener options. Unfortunately, they were all designed for public use — essentially, they all had a form to submit a URL and return a shortened version of it. Some of them had the option of specifying your custom short URL. However, none of them had the ability to manage existing links.
Naturally, I decided to create my own. Perhaps it was slightly egotistical of
me, but since it was meant to power qt.ax
, I decided to name it
QLinks. Since I was lazy, I decided to use Django, which comes with an
autogenerated administration site. I took advantage of that to create the link
management system:
Since this is me, and I have done plenty of things that involve
caching stuff at the Cloudflare edge, I decided to add support for that too. For
this reason, all redirects on qt.ax
are cached and automatically purged when
the destination changes.
An interesting backend feature is the ability to probe all the links and report when the link is dead. For fun, I implemented an email feature: whenever a link transitions from working to not working, an email is generated and sent to the administrator.
Overall, I am pretty happy with how QLinks turned out, and I am especially happy with how quickly I managed to implement it. Thanks, Django!
Globally Distributed Backend
For the backend, I was inspired by a friend’s attempt to create his own CDN (I’ll link it when he’s ready to post) and decided to do something similar. I am still using Cloudflare though, but the CDN is forced to look up the upstream through my own DNS server which does geolocation. The result is that Cloudflare will hit the geographically nearest server. This is not always optimal, but it’s way better than before, where all traffic goes to Montréal, Canada.
To see which upstream server is being used, you can navigate to quantum5.ca/server, and it should return the codename3 of the upstream server used. For reference:
osgiliath
is the server in Montréal, Canada;annuminas
is the server in Amsterdam, the Netherlands; andorthanc
is the server in Sydney, Australia.
I am planning to write a series on using CDNs this way soon™ to complement my friend’s upcoming series on his custom CDN. Stay tuned for that!
Notes
-
At the risk of getting a bit political, there are some controversies surrounding the
.io
domain. While I don’t think it’s likely that it would impact the long-term viability of.io
domains, it’s still something.io
owners should be aware of. ↩ -
Interestingly,
.ca
imposes some restrictions on registration. Essentially, the registrant must have some sort of presence in Canada. I find it somewhat funny that “Her Majesty the Queen” is called out as a special category of entities allowed to register.ca
domains. ↩ -
The names are references to the various palantíri in Tolkien’s Legendarium. ↩