Bad Request (Invalid Hostname)

melli111
melli111 used Ask the Experts™
on
I just created a new website on our company's server through IIS.  I created it with all of the same settings as an existing website that I know works on our server, with the only difference being that the site that works has an unassigned IP address, and the new site has an IP address, and the TCP port is different as well.  All other settings are the same.  When I try to access a page on the new site, I get the error message

 "Bad Request (Invalid Hostname)"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
To see if the web server is working try:

       http://ipaddress:port

If you get a response, then the issue is with dns not resolving the url you are using.

If you don't get a response, then chances are the web server is not running on that ip address.
Chris DentPowerShell Developer
Top Expert 2010

Commented:
If you get 400, Bad Request then no sites configured on the system can answer your request. This typically happens when you have a server configured to use Host Headers. That is, the server will answer "http://www.domain.com", but will not like "http://1.2.3.4", or will not like any name you haven't explicitly configured.

You know you don't need to use a different port, right?

Chris
melli111SharePoint Administrator / Developer

Author

Commented:
We have several different websites set up in IIS.  I did make sure that this website that I am setting up has a different IP than the others.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

melli111SharePoint Administrator / Developer

Author

Commented:
The website configured here does not have any host headers.  All of the other websites set up in IIS do not have an IP address specified, while this website I am setting up needs to have an IP address specified as I am attempting to have the location of this website be able to be viewed outisde of the local intranet.
Chris DentPowerShell Developer
Top Expert 2010

Commented:
Which IP did you give it when you configured it?

To get 400 you're getting to the web server, but it's not finding an appropriate set to answer about, hence bad request.

Chris
melli111SharePoint Administrator / Developer

Author

Commented:
I did someone's suggestion of doing the :portnumber after the IP address, and sure enough, this worked.  This means that the DNS is not configured correctly for the website?
PowerShell Developer
Top Expert 2010
Commented:
It means the web server is not configured correctly.

A name gets you to a server. Ports and sites are the responsibility of the server, not DNS.

Chris

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial