Safe hostnames and IP addresses for examples

Scenario: you’re writing up some documentation for your HTTP library. You’ve been working on it for hours, and it is getting mind-numbingly boring. You need to provide some examples of fetching by hostname and IP address. No problem:


But what happens if someone pastes your example into their code and runs it without thinking to change the hostname/IP? is a real website, currently selling landscaping services. And while doesn’t seem to be serving any content right now, it’s owned by “China Unicom Beijing Province Network”, so who knows what could be served up by that IP in the future?

Fortunately, IANA has been kind enough to reserve some domain names and IP addresses for use in examples.

Safe host names (also good for URLs and email addresses):

  • *
  • *
  • *
  • *.test
  • *.example
  • *.invalid

Note that IANA actually returns a web page for,, and The reserved TLDs (.test, .example, and .invalid) do not have any full hostnames that resolve to any actual servers that I’m aware of.

Safe IPv4 addresses:

  • to
  • to
  • to

For IPv6, IANA has reserved the unicast prefix 2001:DB8::/32, so anything from 2001:DB8::1 to 2001:DB8:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF is safe (h/t @AKostur ).

There are lots of good options for example IP addresses and hostnames. Don’t be lazy and don’t be cute: just use the reserved ones.