Iis – How to locally define how a URL is resolved in Windows/IIS

iisiis-7iis-7.5url-routingwindows-server-2008

I know that there is a way to make any defined URL resolve to a different URL, but I can't remember how or where to define this setting.

I understand this is ambiguous, so consider the following example. I am building http://www.webapplication.com. I have set up the web site in IIS 7. However, I haven't forwarded the nameservers to resolve my server yet, so the URL points to somewhere else completely. However, when I access http://www.webapplication.com locally, I would like the IIS 7 website to be resolved.

How can I do this? Is this a setting in IIS, the individual browser (IE or Chrome) or somewhere else (like my network settings)?

Best Answer

The name resolution is handled through DNS so if you need the host to resolve to a different machine you would need to modify DNS. If you only want it to resolve differently for your test machine you could modify the \windows\system32\drivers\etc\hosts file on the machine you'll be browsing from.

Note 1: the typical location for hosts is under \windows, but you should check %SystemRoot% for the locaiton on your system.

Note 2: your AV program may complain if you try to edit this file.

You would have to modify your DNS server to change DNS. I can't tell you whether it is a local or internet based DNS.