I know how to configure one IIS instance to run many websites using the same public ip address, but different domain names (As long as I have control over the domains).

But how can you configure many IIS servers running on different virtual machines in the same network, to host websites using the same public IP addres, but different domain names?

Normailly in IIS under the website you can set the headers to which the website will respond to. but what if that website is on a different machine?


Let me explain better. Pretend that you have only one public IP address that you can use to serve up websites. You want to expose multiple websites under that same IP address, but the websites live on different physical machines, within your network.


You can do this with a load balancer or with Microsoft's Network Load Balancer (NLB).

NLB can take 1 IP and listen on that IP on multiple servers (it may take some network changes depending on your network).

However, I recommend the load balancer approach. If you're using IIS7, then use Application Request Routing (ARR). It's a tiny add-on to IIS 7 and works as a reverse proxy. Have the IP live on your 'front end' node and it will act as a reverse proxy to get the requests from the other servers. The other servers (front end node too) will all need to have internal IPs.

  • Point all domains to the same IP address, obviously

  • In IIS (which version?) set up multiple websites. In the bindings (where you attach them to ip addresses) you can set the HOST HEADER. Put in the domain there.

This way when a request comes for address X, IIS can separate them ou tdepending on the host header (www.serverfault.com etc.). The browser sends the requested domain in a field named "Host Header" to the server for exactly this reason.



And, with a lot of background:


  • THanks tom. But I know how to do this. What I meant was if the websites are on different physical servers internally on your network, but you have only one public IP address to use for serving websites. – 7wp Mar 9 '10 at 6:46
  • 2
    Then you need a reverse proxy - I basically do the same, using Microsoft TMG (Thread Management Gateway), basically a firewall. There I can publish internal websites - it creates a listener and forwards the requests. Can do the same also for SSL. Without additional software Windows does not have these capabilities. Decent software for this includes IIRC Squid (Linux / Free) in reverse proxy mode, and the mentioned TMG (Thread Management Gateway). – TomTom Mar 9 '10 at 7:01
  • 1
    Apache also makes a fine reverse proxy. – John Gardeniers Mar 9 '10 at 10:33
  • And a cheap one, too. Agreed - good choice. – TomTom Mar 9 '10 at 11:22

A word of caution, though... if any of them are SSL secured, this is going to cause you problems depending on the proxy you use. If all it does is inspect the host header and forward the traffic, it won't work because the host header is part of the encrypted portion of the traffic.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.