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)?


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.

  • The hosts.txt file sounds familiar. Where is that located? Also, where do I go to modify DNS? – smartcaveman Jun 10 '11 at 21:32
  • Linux/Mac uses /etc/hosts and on Windows you'll need to edit C:\Windows\system32\drivers\etc\hosts – Matt Beckman Jun 10 '11 at 21:39
  • Thanks Matt. Its hosts not hosts.txt. fixed above – uSlackr Jun 10 '11 at 21:41

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.