0

Can anyone confirm or deny that it is possible to set an IP address as a host header on IIS 6.0?

I have seen others on forums that claim to have made this work however I am having no luck with a "Bad Request (Invalid Hostname)" for reply.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
baileyswalk
  • 1,198
  • 2
  • 17
  • 29
  • See post here for answer: http://stackoverflow.com/questions/6863464/wcf-is-using-the-computer-name-instead-of-the-ip-address-and-cannot-be-resolved/6911265#6911265 – baileyswalk Aug 02 '11 at 11:34

1 Answers1

1

I believe you can assign a website to different IP addresses, if your server has multiple addresses. However looking at our server, its assigned to the local network IP address, not the internet IP address. I don't think what your asking can happen since the IP address is not sent as part of the HTTP request. The only way I think it would work is if you have your router/firewall redirect different IP address requests to different ports on the web server, then you can bind your sites to the ports instead of the host header.

Kratz
  • 4,280
  • 3
  • 32
  • 55
  • The problem I am having is a WCF service is substituting the IP address for the machine name resulting in clients outside of the LAN are unable to add a service reference. I think I am going to have to get a domain name to resolve this though. – baileyswalk Aug 01 '11 at 14:57
  • Sorry, not much experience with services. – Kratz Aug 01 '11 at 15:15
  • @bailey: please put that information into your question. It completely changes the answer! – John Saunders Aug 01 '11 at 15:58
  • @John: Hi John sorry didn't really intend to stray off initial topic, just isolating areas of the problem as have had no luck asking more general questions - if it were possible to use the IP address as a host header I would have had my solution. However it would seem it is not possible. – baileyswalk Aug 02 '11 at 08:21
  • @bailey: host header isn't your problem at all. Your problem is that IIS is responsible for the value that appears in the metadata and you need to learn how to tell IIS to put the host name there. – John Saunders Aug 02 '11 at 15:47
  • @John: I tried that via the command line and using the IIS metabase explorer (actually thought this was just the same as changing the host header) but it gave me a bad request invalid host error. I have a better solution now anyway. – baileyswalk Aug 05 '11 at 08:21