Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear Experts,
I am having many Demo Applications on my IIS Server. I am accessing the websites using localips:portnumber. This uproach of managing my applications is poor as I may forget my port while I am at client side. Can you please help me on how I can manage an intranet domain handler to route my websites internally.

What I have tried:

I can't give live ip and domain name because I want security.
Posted
Updated 3-Sep-21 3:31am

1 solution

Assuming you're accessing the demos on the local PC, you can use the HOSTS file to map dummy domain names to the loopback address.

Run notepad as administrator, and open C:\Windows\System32\drivers\etc\hosts - the file has no extension, so you'll need to select "all files" in the file-type dropdown.

Go to the end of the file, and enter a mapping followed by a blank line. For example:
127.0.0.1 demo1.local
This will map the name demo1.local to your computer, but only when accessed from your computer.

Then, in IIS Manager, edit the binding for your site, leave the default port, and set the "Host name" to demo1.local.

You will then be able to access that site using http://demo1.local - but only on your local PC.
 
Share this answer
 
Comments
Member 15099244 3-Sep-21 11:09am    
127.0.0.1:89 demo1.local
I want to map the port of the ip to a specific domain.
Richard Deeming 3-Sep-21 11:11am    
No, domains don't care about port numbers. Map the domain to the loopback address, and use the default port and the host name in the IIS binding.

You can have multiple sites on the same IP address and port number, so long as they all have different host names.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900