,, and the like


* resolves to * too.

When experimenting (e.g. with Dokku) it’s useful to be able and set up some resolvable DNS name that maps onto a specific address, without the need to get our own domain.

Enter, and - if all that you need back is just, everything that still works in this gist.

There are a few variations that can be useful, let’s see some examples assuming that our target IP address is

  • For something really intuitive and quick, just put your IPv4 address and follow it with   # -->
  • everything that comes before it is valid too, i.e. there are wildcards all down the rabbit hole:        # -->, a regular service   # -->, first-level wildcard # -->, second-level wildcard
  • if all these dots are likely to annoy your application, it’s possible to substitute them with dashes. It’s still quick, although possibly a little less intuitive:            # -->, look, dashes!   # -->, *dot* after whatever   # -->, *dash* after whatever
  • Too long to type? Hexadecimal representation to the rescue! The hexadecimal counterpart of is 0a141e28, so:            # -->, look, hexadecimal!   # -->, *dot* after whatever   # -->, *dash* after whatever

Want to transform your dotted representation into hex? No problem:

$ perl -e 'printf "%02x%02x%02x%02x\n", split /\./, shift'
  • Need support for IPv6? Shift to, two additional chars to type but you’re asking for 6 instead of 4, so you have to give 2 more! In this case, you can only go with dashes:                  # --> ::1  # --> 2a01:4f8:c17:b8f::2
  • In a local development environment, you can also leverage many more services that support wildcards and just answer with

So now, future me… you will not forget!

To everyone else: stay safe folks!

Comments? Octodon, , GitHub, Reddit, or drop me a line!