My Profile Photo

Sheogorath's Blog

Please use official example and test domains

on

Every now and then, you want to make an example. Suddenly you end up with the wildest domain names in these examples. A popular misuse of an IP that suddenly became a real address was 1.1.1.1 but there is a solution for this.

There are some officially reserved and from IANA registered test and example domains that are safe to be used in books, articles and your documentation.

Besides the popular example.com and example.net all .example domains as well as all .test domains work. If you need an example that points at localhost, there is also .localhost.

If we take HedgeDoc as an example a nice way to identify an instance in an example would be hedgedoc.example.net or hedgedoc.example making sure there is no unexpected traffic disclosure.

When it comes to IPs there are also reserves networks for examples and test cases: 192.0.2.0/24 and 2001:db8::/32 so you don’t need to contaminate RFC1918 ranges.

TL;DR

Use:

  • <your thing>.example.net for subdomain examples
  • <your thing>.example for domain examples
  • <your thing>.localhost for localhost examples e.g. in configurations
  • 192.0.2.5 for IPv4 examples
  • 2001:db8::/32 for IPv6 examples

References: