Why do I need to edit the hosts file to make my ASP.NET projects work properly with IIS? -
this way have been taught:
- add website iis , point asp.net files.
add host name within iis , example of be:
myaspproject.local.co.uk
add same host name in host file , example of be:
127.0.0.1 myaspproject.local.co.uk
why need edit host file have above? please explain story point user enters url in browser.
what looking @ here called 'domain name resolution'. can complicated subject simplified explination show doing here.
when type name browser asking browser retrieve page. let's assume typed in 'www.stackoverflow'com'. computer cannot connect www.stackoverflow.com because computers talk using number, not letters; in case number talking 'ip address'. need ip addresss associated 'www.stackoverflow'com'.
the way computer reach out domain name server (dns) , ask "what ip address associated name 'www.stackoverflow.com' ?". dns return ip address of stack overflow , computer talk server on address.
now, before computer talks dns couple of other things, first checks local cache see if has asked dns question , got response, check hosts file (this asking about) see if there ip address associated name on computer.
in case have ip address associated name, have associated 127.0.0.1 special ip address tells computer "look inside yourself" local ip address. else trying same ip address inside own computer, not yours.
does answer enough you?
Comments
Post a Comment