I am constantly reading tech news. After Reddit’s controversial API changes earlier this year, I left the platform as my third party app of choice was shutdown. Although I was no stranger to Hacker News (Ycombinator), it quickly became a new refuge for me — lots of high quality and very technical topics and discussion.
A few months ago a post caught my eye, announcing that “Localhost Will Inevitably Die” (ycombinator). It linked to Lucas F. Costa’s blog article of the same name, which is a great read for anyone working in DevOps.
It argues that, at some point, development must move off local machines into production (which invariably means cloud these days), and the sooner you can set up your IaaC and a staging environment in the cloud, the better.
While I wholeheartedly agree, there’s also a dynamic that comes from using localhost to be able to more rapidly prototype changes. Instead of waiting for a strict linter, build processes, AMI generation, and deployment process to check small changes, it’s incredibly useful to be able to quickly check small changes or do some rapid prototyping (especially for new projects).
A struggle I had recently was dealing with some strict HTTPS transport stuff while working locally. Testing an Android app against the local environment required root CA certificate — not just issuing a self-signed cert, or even setting up your own CA and doing the CSR method.
So I had no choice but to setup a domain name for my localhost. Luckily, as a web consultant, I have a number of ‘spare’ domains that I could choose from. While there’s a certain irony to naming your local environment after a plumbing company, I wanted something a little more unique, but also more affordable. After all, there has to be something cheaper than .com, for throwaway domains, right?
I searched a number of registrars for the best deals. While you can often get a first-year or new customer deal for domains, even weird TLDs like .club often cost MORE than .coms after the first year. The .online was tempting at only $2.88 and .site at $1.78 per year. But those are limited to “one per customer”, and I knew that I may need a handful of domains to test more complex scenarios, or to share with other developers.
While reading Hacker News, a random commenter gave me the solution. I had never heard of the 1.111B class of .xyz domain names before, but it was just what I was looking for! Daniel Negari, CEO of .XYZ, realized that number domains on a non-mainstream TLD were basically worthless. So they enforced a $0.99 / year price for all-number domains with 6, 7, or 8 digits. There’s a little over a billion addresses in this range, and at a dollar each, that could be a billion dollar idea.
So I registered one and tried it out.
First, there’s a minor snafu with a long TTL on the SOA record — 24 hours. Which means, the immediate changes I made to the DNS were not being picked up until after that expiry. So I had to wait for a day before I could complete my DNS validation for a certificate.
After that SOA change took place, though, I haven’t had any problems using it as a ad-hoc domain, a replacement for localhost.
I am working on migrating old properties away from the Quantum Leap Chicago branding, but one of my hosting solutions requires a primary domain. As such, I registered another 1.111b address to use there. Success!
In addition, from a security point of view, you should be using HTTPS even on localhost development. A very common lateral movement technique intercepts and listens to LAN and localhost traffic to try and discover services. One more layer of security!
These cheap domain addresses are incredibly useful for these purposes. They are a great kept secret that I’m sharing with you for free. Imagine what we could do together! Contact us for a consultation today.