• 1 min read

IANA reserved domains.

There are a few domains that are reserved by IANA. Reserved means that these domains can’t be registered by anyone, and can’t be transferred. One of them is example.com.

Such domains are sometimes called special use domain names, and the full list can be found here.

Special TLDs

The most notable special TLDs are:

  • test
  • example
  • invalid
  • localhost

How to use special domains?

RFC 2606 specifies best practices on how to use the special domains. It recommends the following:

  • test domains are recommended for testing “DNS related” code.
  • example domains are recommended for documentation and examples.
  • invalid domains are recommended for demonstrating invalid domain names.
  • localhost domains are reserved for loopback addresses to the local host (so local networks don’t break).

There’s also RFC 6761 with more information, like how DNS servers should handle these domains.

Why are special domains useful?

Special domains guarantee deterministic behavior in tests and documentation.

Let’s say I make up a domain for (local) testing, where I expect certain behavior (e.g. it must resolve, or it must fail). It could happen that at some point the domain becomes available, gets registered, and now my test will behave unexpectedly.

This is for example what happened with the dev TLD! It was sometimes used for testing (locally), but then Google “bought” it.

Thanks for reading!
If you have ideas how to improve this post, let me know on GitHub.