views:

269

answers:

5

Let's say you want to provide an example url in documentation somewhere. The correct thing to do is use example.com, since that is the defined location for such things and anything else you come up with is likely to be actually registered somewhere and serving up who knows what to your readers.

My questions is, what do you do if you need to provide 2 contrasting examples? The best I've seen is site1.example.com and site2.example.com, but that doesn't always cut it. Any other ideas?

Update:
Accepted @Yuval's answer, since it is the most technically correct response. However, due to forces beyond my control I'm actually going with Jekke's (tempuri.com).

A: 

You can also use tempuri.org, like is used in many XML-based examples.

Jekke
Those are generally microsoft-specific. I might just as well use contoso or microsoft.com. But I suppose it's better than many alternatives.
Joel Coehoorn
That domain name always makes me think of Japanese food.
Greg Hewgill
This domain's holder is Microsoft. This is even worse than using your own domain name because its future is completely dependent on one company.
bortzmeyer
+14  A: 

Use example.net and example.org.

Per RFC 2606, they are all reserved (Wikipedia summary).

Yuval A
and example.net don't forget
DrG
If "site1.example.com" vs "site2" isn't good enough, I doubt I'll be able to pass .net vs .org. But it's a good answer: upvote
Joel Coehoorn
Per the same RFC, you can do foo.test or foo.invalid.
Craig Stuntz
@Craig - that is basically correct, but they do look less like a valid URL, so might be less suitable for example URLs
Yuval A
You take what you can get. :)
Craig Stuntz
A: 

I'm wondering if you can squeeze in some character into the URL that would make it invalid if cut and pasted into a browser. A little like 555-XXXX numbers in movies.

Uri
How about xn--example.com?
mercator
A: 

There is also example.net and example.org. If you need another, I don't see a problem with using a domain you already control.

greyfade
Documentation often outlast domain names... and even companies. What will become of this domain name in a few years?
bortzmeyer
+2  A: 

RFC 2606 also reserves the TLD (Top-Level Domain) ".example" so you can use "foobar.example", "something.example", "stackoverflow.example", etc.

Unfortunately, all these names include the string "example" and therefore are not distinguishable enough in documentation. I hope there will be an update of RFC 2606 one day, with more names.

bortzmeyer