Bad Request (Invalid Hostname) on Win2K3 Server

Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 00:23:15 von Mark Findlay

Hello Experts,

I am running Windows 2003 Server and IIS. I have a static IP which points to
a default website on the server.

The problem is that I can not access the site from the server when I use
localhost, 127.0.0.1, or the static IP. It returns the message: "Bad Request
(Invalid Hostname)".
The site however is accessible from outside when the domain name is
specified since I use host header records within the default site
definition.

The HOSTS file on the server has a localhost entry for it, pointing to
127.0.0.1 and when I ping localhost from the server I get a response from
127.0.0.1, but if I try and access the default site from the server in IE,
using either the static IP, localhost, or 127.0.0.1, I get the "Bad Request
(Invalid Hostname)" message.

I'm guessing this is a pretty typical problem, but it's definitely outside
of my league. Can anyone describe (in VERY layman terms for me :) what I
need to do to get http://localhost to work?

Many thanks!
Mark

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 01:42:27 von Todd J Heron

In the IIS properties of the default web site, set the IP Address to "All
Unassigned".

--
Todd J Heron, MCSE
Windows Server 2003/2000/NT; CCA
------------------------------------------------------------ ----------------
This posting is provided "as is" with no warranties and confers no rights

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 02:13:12 von Mark Findlay

Hi Todd,

Unfortunately, that did not work. Could it be that I need to add anything to
my DNS?

Thanks,
Mark

"Todd J Heron" wrote in message
news:%23m6CbBWlFHA.2608@TK2MSFTNGP14.phx.gbl...
> In the IIS properties of the default web site, set the IP Address to "All
> Unassigned".
>
> --
> Todd J Heron, MCSE
> Windows Server 2003/2000/NT; CCA
> ------------------------------------------------------------ ----------------
> This posting is provided "as is" with no warranties and confers no rights
>

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 02:28:04 von Administrator

In news:%23eX5kSWlFHA.3568@TK2MSFTNGP10.phx.gbl,
Mark Findlay posted this:
> Hi Todd,
>
> Unfortunately, that did not work. Could it be that I need to add
> anything to my DNS?

Did you add a host header?
Web siite properties, Web Site Tab, Advanced button.
You will need to add a host header for "localhost" if you did.



--
Best regards,
Kevin D4 Dad Goodknecht Sr. [MVP]
Hope This Helps
===================================
When responding to posts, please "Reply to Group"
via your newsreader so that others may learn and
benefit from your issue, to respond directly to
me remove the nospam. from my email address.
===================================
http://www.lonestaramerica.com/
===================================
Use Outlook Express?... Get OE_Quotefix:
It will strip signature out and more
http://home.in.tum.de/~jain/software/oe-quotefix/
===================================
Keep a back up of your OE settings and folders
with OEBackup:
http://www.oehelp.com/OEBackup/Default.aspx
===================================

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 05:08:06 von Bernard

If you had configure host header for the website, browsing it via IP will
returns the error you see.

--
Regards,
Bernard Cheah
http://www.microsoft.com/iis/
http://www.iiswebcastseries.com/
http://www.msmvps.com/bernard/


"Mark Findlay" wrote in message
news:%23qvRIVVlFHA.2180@TK2MSFTNGP15.phx.gbl...
> Hello Experts,
>
> I am running Windows 2003 Server and IIS. I have a static IP which points
> to a default website on the server.
>
> The problem is that I can not access the site from the server when I use
> localhost, 127.0.0.1, or the static IP. It returns the message: "Bad
> Request (Invalid Hostname)".
> The site however is accessible from outside when the domain name is
> specified since I use host header records within the default site
> definition.
>
> The HOSTS file on the server has a localhost entry for it, pointing to
> 127.0.0.1 and when I ping localhost from the server I get a response from
> 127.0.0.1, but if I try and access the default site from the server in IE,
> using either the static IP, localhost, or 127.0.0.1, I get the "Bad
> Request (Invalid Hostname)" message.
>
> I'm guessing this is a pretty typical problem, but it's definitely outside
> of my league. Can anyone describe (in VERY layman terms for me :) what I
> need to do to get http://localhost to work?
>
> Many thanks!
> Mark

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 09:41:03 von Kristofer Gafvert

Hi Mark,

You say:

"...since I use host header records within the default site definition"

Does this mean that you have a host header name specified for the website?
If so, there are a few options.

Either you create a new identity for the website with a blank host header
name. To do this:

Open IIS Manager.
Right click the website and click Properties.
Click on the Advanced button.
Click Add and fill in the text boxes, but leave "Host Header Name" empty.

Now all requests with a host header name that does not match any other
website, will end up in this website.

-or-

You add "localhost" to the list of host header names. To do this:

Open IIS Manager.
Right click the website and click Properties.
Click on the Advanced button.
Click Add and fill in the text boxes, write localhost in the text box for
"Host Header Name".

Now request with a host header of "localhost" will get to this website.

--
Regards,
Kristofer Gafvert (IIS MVP)
http://www.gafvert.info - Articles and help


Mark Findlay wrote:

>Hello Experts,
>
>I am running Windows 2003 Server and IIS. I have a static IP which points
>to a default website on the server.
>
>The problem is that I can not access the site from the server when I use
>localhost, 127.0.0.1, or the static IP. It returns the message: "Bad
>Request (Invalid Hostname)".
>The site however is accessible from outside when the domain name is
>specified since I use host header records within the default site
>definition.
>
>The HOSTS file on the server has a localhost entry for it, pointing to
>127.0.0.1 and when I ping localhost from the server I get a response from
>127.0.0.1, but if I try and access the default site from the server in IE,
>using either the static IP, localhost, or 127.0.0.1, I get the "Bad
>Request (Invalid Hostname)" message.
>
>I'm guessing this is a pretty typical problem, but it's definitely outside
>of my league. Can anyone describe (in VERY layman terms for me :) what I
>need to do to get http://localhost to work?
>
>Many thanks!
>Mark

Re: Bad Request (Invalid Hostname) on Win2K3 Server

am 31.07.2005 10:07:37 von Mark Findlay

Thanks Kristofer, that was indeed the last piece of the "puzzle".

For anyone else reading: I now have the following properties for my default
web site

The static IP address is specified in the property page for the site
In the Host Headers, I have:
2 host headers for mydomain.com and www.mydomain.com, both of which
point to the static IP of the site
localhost, pointing to the static IP of the site
pointing to the static IP of the site

Now I can reach my site via mydomain.com, www.mydomain.com, just my IP
address, or, from the server, by typing in localhost.

Thanks to everyone for their expert advice!!

Mark



"Kristofer Gafvert [MVP]" wrote in message
news:xn0e5eb6q2ku64200i@news.microsoft.com...
> Hi Mark,
>
> You say:
>
> "...since I use host header records within the default site definition"
>
> Does this mean that you have a host header name specified for the website?
> If so, there are a few options.
>
> Either you create a new identity for the website with a blank host header
> name. To do this:
>
> Open IIS Manager.
> Right click the website and click Properties.
> Click on the Advanced button.
> Click Add and fill in the text boxes, but leave "Host Header Name" empty.
>
> Now all requests with a host header name that does not match any other
> website, will end up in this website.
>
> -or-
>
> You add "localhost" to the list of host header names. To do this:
>
> Open IIS Manager.
> Right click the website and click Properties.
> Click on the Advanced button.
> Click Add and fill in the text boxes, write localhost in the text box for
> "Host Header Name".
>
> Now request with a host header of "localhost" will get to this website.
>
> --
> Regards,
> Kristofer Gafvert (IIS MVP)
> http://www.gafvert.info - Articles and help
>
>
> Mark Findlay wrote:
>
>>Hello Experts,
>>
>>I am running Windows 2003 Server and IIS. I have a static IP which points
>>to a default website on the server.
>>
>>The problem is that I can not access the site from the server when I use
>>localhost, 127.0.0.1, or the static IP. It returns the message: "Bad
>>Request (Invalid Hostname)".
>>The site however is accessible from outside when the domain name is
>>specified since I use host header records within the default site
>>definition.
>>
>>The HOSTS file on the server has a localhost entry for it, pointing to
>>127.0.0.1 and when I ping localhost from the server I get a response from
>>127.0.0.1, but if I try and access the default site from the server in IE,
>>using either the static IP, localhost, or 127.0.0.1, I get the "Bad
>>Request (Invalid Hostname)" message.
>>
>>I'm guessing this is a pretty typical problem, but it's definitely outside
>>of my league. Can anyone describe (in VERY layman terms for me :) what I
>>need to do to get http://localhost to work?
>>
>>Many thanks!
>>Mark