I like to use an obviously dummy domain name in a sample url, and put < > around it to emphasize it should be replaced. Unfortunately this is interpreted on StackExchange in a way that hides the whole domain name, displaying http:///rest/of/url. What is the right syntax to escape the < and > characters so they and their contents are displayed?
The short answer is that you can use HTML entities:
- > >
- < <
Additionally, the brackets are reserved when using preformatted/code markup:
<some text here>
But for examples, the better practice would be to the IANA reserved domains, as they will never point to a live website, and search engines will not try to browse them.
RFC 2606 reserves additional top-level domains which may be appropriate:
".test" is recommended for use in testing of current or new DNS related code.
".example" is recommended for use in documentation or as examples.
".invalid" is intended for use in online construction of domain names that are sure to be invalid and which it is obvious at a glance are invalid.
The ".localhost" TLD has traditionally been statically defined in host DNS implementations as having an A record pointing to the loop back IP address and is reserved for such use. Any other use would conflict with widely deployed code which assumes this use.