RSS feed
<< Making your Java app shine on OS X | Home | Lucene gets a performance boost >>

The extra dot in dot-com

Sun no longer claims they "put the dot in dot-com", but did you know there's actually more than one dot in dot-com?

According to RFC1034 "" is a relative domain name. The complete domain name (also called absolute) is "" (Notice the trailing ".")

Reading this RFC one should think that adding a trailing dot to a domain name should have no effect. All you're doing is to be explicit by using the absolute representation of the domain right?

Not quite so. It doesn't seem like web server vendors and administrators have read this RFC and neither have web browser vendors. This becomes a problem if you're using name based virtual hosting on your web server. When the server gets a request for "" it won't have a clue that the user is actually looking for the content at "".

So I did a little survey on the web servers I use. The Apache HTTP Server handles the trailing dot perfectly. Tomcat doesn't understand it and serves content from the default host instead. You can mediate this by always adding an alias with the trailing dot, but that's a hack and it's something the server should handle by itself.

I was a little disappointed to find that Jetty (my favorite web server) failed the trailing dot test. But then I remembered how nice the Jetty developers are so a couple of weeks ago I decided to fix the problem and  submit a patch for it. Today Greg applied it. From the next release onwards, Jetty will normalize host names before comparing them. Try reporting something like that to IBM or BEA and you'll find out why Jetty rocks!

Now, just for the fun of it, let's take a look at how some big sites handle requests with trailing dots:

Microsoft: Bad request

Microsoft solves the problem the easy way. Just blame it on the user:

MSN: Page not found

MSN is a little more polite, they even say they're sorry:

Myspace: Redirect to google

I knew Myspace and Google made an advertising deal, but this is just weird:

Facebook: Redirect to

Facebook is getting so big they seem to have started a facebook inside the facebook, but there's no response there:


NSA: Trust no one, say nothing

One can say a lot about the NSA, but don't give them a trailing dot because they will refuse to talk to you. Period.

Sun: Page not found

Sun may once have "put the dot in dot-com", but that's no longer the case. They're more sorry than MSN though. Sorry with an exclamation point. And what makes them think I own documents at

Add a comment Send a TrackBack