Background
Example domains
Documentation needs addresses that look real but lead nowhere. Some names are reserved for exactly that. Others, such as example-petstore.com, only look like examples: they are ordinary registered domains, and whatever is sent to them reaches a real server.
Reserved names
Two standards reserve names for documentation and testing:
- RFC 2606 (1999) reserves the second-level domains
example.com,example.netandexample.org, and the top-level domains.test,.example,.invalidand.localhost. - RFC 6761 (2013) sets out how software and DNS should treat these special-use names.
IANA runs a simple page on example.com and states that the example domains may be used in documents
without asking permission. It expects some traffic from incorrectly configured applications and asks developers not
to build anything that depends on it.
Registered look-alikes
Names like example-petstore.com, example-commerce-host.com or my-example-blog.com contain the word “example”, but they are not reserved. Anyone can register them, and then every link, form, tracking call or API request that uses them reaches that owner, including any credentials inside. Research on look-alike domains shows how much this can be: a 2017 study found that typo domains of popular email providers received hundreds of thousands of misdirected emails a year.
Google used example-petstore.com and example-commerce-host.com in its Analytics and Search documentation from 2009 on. The history lists where and when.
Which names to use
| You need | Use | Avoid |
|---|---|---|
| A website | www.example.com | made-up names such as example-petstore.com or mysite.com |
| A second domain (cart, checkout, partner) | example.net or example.org | example-commerce-host.com, example-b.com |
| Subdomains | shop.example.com, api.example.com | api.example-petstore.com |
| An internal or test host | app.test, db.example | real-looking names under .com or .io |
| An address that must never resolve | anything.invalid | — |
| An email address | user@example.com | addresses on registered domains |
What this domain does
example-petstore.com and example-commerce-host.com show an explanation on every address, answer API requests with
410 Gone and a JSON explanation, and point visitors to step-by-step guides
for removing the names from their sites and code.
Sources
- RFC 2606: Reserved Top Level DNS Names IETF
- RFC 6761: Special-Use Domain Names IETF
- Example Domains IANA
- IANA-managed Reserved Domains IANA
- Email Typosquatting (Szurdi and Christin, IMC 2017) ACM Internet Measurement Conference