IIS Custom site not reachable in localhost

Ivan Kanchev 121 Reputation points
2021-12-20T20:07:07.447+00:00

Hi all,

So i am trying some basic setup that is not working for some reason.
I have one VM with Server 2016 where i have IIS installed. The Default site is working fine. I am trying to add second site on custom port for testing purposes.
I created new site as below:
159007-image.png

I modified the bindings:
159101-image.png

But when i try to access this site i get unreachable:
159102-image.png

Last i have created DNS record:
159029-image.png

Any suggestion is welcome.

Windows development Internet Information Services
{count} votes

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2021-12-20T22:50:09.513+00:00

    Leave the port # alone. When you are hosting multiple sites then that is where the host header comes in. When IIS gets a request it looks at the host header name. If that matches the name of a site then it matches to that site automatically. If none of them match then it is going to go to the default site (assuming it also isn't using a host header). You don't need to change port #s at all.

    The only time you should be changing port #s is if you need to host multiple sites on the same server and you cannot use host headers. Of course for a host header to work at all you also need to ensure that you've configured a DNS record to point to that same server. Given your example you need to have configured DNS to map that DNS name to your server (or do it in a .hosts file if you're testing locally).


1 additional answer

Sort by: Most helpful
  1. Ivan Kanchev 121 Reputation points
    2021-12-21T09:30:01.13+00:00

    It turns out the answer was much simpler.
    After creating the new site i needed to add entry in the hosts file. No DNS record was needed.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.