I have set up a local site under IIS 7.5 under port 900. to access it I should type localhost:900 in the address bar.
I'm a little bit familiar with the System32\Drivers\etc\hosts file and I know I can define my custom name with IP adderss there. For example I can add: MyLocalSite and whenever I type in http://MyLocalSite in the browser, The DNS resolves its IP as
Is there anyway that I can specify port number in that file as well? (e.g. MySecondSite and the DNS resolves it correctly) I tried and with no luck.


Kamyar, Sadly, the hosts file only associates a name to an IP address. Adding a port would make the syntax invalid.

Check out Windows HOSTS file

  • Tanks Jeff. Too bad. – Kamyar Jan 5 '11 at 20:22

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.