tags:

views:

32

answers:

2

I am running an IIS 7.5 site that serves up content for http://www.foo.com/

I've been asked to properly route http://www.foo.com./ (note the trailing dot). If you hit that page now, you'll get an IIS error:

Bad Request - Invalid Hostname

HTTP Error 400. The request hostname is invalid.

This happens even for http://www.microsoft.com. I have seen some sites route trailing periods successfully (like http://www.amazon.com./), but it looks like most of those were using Apache, not IIS.

I added a host header in IIS for www.foo.com. which is allowed. However, it won't let you start the site. It won't start and pops up a message box saying:

Value does not fall within the expected range.

Does anyone know how to serve up domains with trailing dots in IIS?

A: 

The trailing dot is an absolutely legal part of the hostname - it's just that it's normally invisible because it's implicit in DNS. If the trailing dot is present it's called a "Fully Qualified" Domain Name (FQDN).

Note that on the wire DNS always deals in FQDNs.

File a bug report with MS.

Alnitak
I agree that MS is in the wrong here, just trying to find out if there might be a workaround.
Aaron D
A: 

Hi there,
I am sure that there is a bug somewhere but the question is what the bug is.

I think that the bug is that IIS allows you to set a host header with a trailing ".". The host header is not the same thing as a FQDN. The host header is meant to match the Host directive in the HTTP request:

GET / HTTP/1.0
HOST: www.doilooklikeicare.com

It is certainly valid in the URL typed in to the browser eg: http://www.doilooklikeicare.com./default.aspx as this is resolved to find out WHERE to send the request.

Try removing the trailing dot in the host header and it should work OK. You will still be able to use it in the URL.

Hope this helps

Jonathan

Jonathan Stanton
The name is resolved, IIS handles your request, but you get a 400 Invalid Request when you click the link you provided. That is exactly what I want to avoid. I can serve up **www.foo.com** without issue. I cannot seve **www.foo.com.**
Aaron D