0

I have an IIS 8 (win 2012 r2) server with multiples sites and ports:

I would use FQDN to access to sites . for exemples :

site1.lan : @IP_of_iis_server:9500
site2.lan : @IP_of_iis_server:2729

etc ..

I add a new Host (A) in the DNS Server , but he don't accept ports with the IP

How i can resolv this Thanks!

K. ON BUG
  • 3
  • 1

1 Answers1

0

The DNS A record only tells a client to what IP address a name resolves, so what you describe is expected behavior.

There are a few ways to be able to reach different sites on your server. The least complicated one would be to simply inform clients what service lives on what port. In other words a client couldn't just go to "http://site1.lan" or "http://site2.lan", but instead they would need to explicitly tell the web server that they want "http://site1.lan:9500", "http://site2.lan:2729" or any valid combination of names and ports (because the different DNS records point at the same address).

What you probably want instead, is a reverse proxy in front of your sites, that listens on standard ports like 443 (HTTPS) or 80 (HTTP), and then sends the client to the correct port depending on what hostname or path they asked the proxy for.

Personally I like using HAProxy for these things, but according to my search engine you could probably do it natively in IIS using URL Rewrite v2 and Application Request Routing.

Mikael H
  • 5,031
  • 2
  • 9
  • 18
  • could not replace site1 by the ip adress and the port ? in iis binding for example ? – K. ON BUG Jan 28 '19 at 10:49
  • That will achieve exactly the same thing that you already do: The server will listen on the defined IP address/port combination. The clients still need to know how to connect to the site, either explicitly (in the request) or implicitly (by being routed by something you've set up in front of the site). – Mikael H Jan 28 '19 at 11:22