opsira

Publishing a test site without touching DNS

In short

Showing someone a work in progress usually means either a DNS record you will forget to remove, or a screenshot. There is a better middle option.

The trick

Wildcard DNS services resolve any hostname containing an IP address back to that address. A hostname of the form anything.203.0.113.10.nip.io resolves to 203.0.113.10, with no configuration and no records to create.

Point a reverse proxy router at that hostname and you have a working URL for a site that has no domain yet.

Why it is useful

Certificates work

Automatic certificate issuance works against these hostnames, because they resolve publicly like any other name. You get real HTTPS, not a warning screen, which matters when the point is showing someone a finished looking thing.

Keep it out of search results

This is the part people forget. A publicly resolvable staging site with real certificates is a publicly indexable duplicate of your content.

Put an authentication layer in front, or return a blanket disallow to crawlers, or both. Duplicate content on a preview host is a self inflicted problem that outlives the preview.

Limitations

The hostname contains the server address, so do not use it where that is sensitive. It depends on a third party service remaining available, so it is unsuitable for anything permanent. And rate limits on certificate issuance apply per registered domain, which is shared across everyone using the service, so heavy automated use can hit them.

For its intended purpose, which is temporary and disposable, none of that matters much.

The pattern underneath

Once routing is hostname based, hostnames become free. Running several sites behind one proxy means adding one is a configuration entry, not an infrastructure task, and the friction of trying something drops to nearly zero.

Need help with any of this?

These notes are free and always will be. If you would rather someone just set it up, or you are stuck on something similar, get in touch at hello@opsira.io.