When I need to access some urls, I modify the content of “hosts” file in System32.
I am confused about this.
When should I change this file? What can this file do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I normally think about the hosts file as my local DNS.
As you know, the internet is made of computers, each having its own unique IP address. So for exmaple, in command line, if you ping google (via the command: ping http://www.google.com), you will get a respoinse with the ip address for google. In my case, it returned 173.194.77.99. Now, if I enter this number to the address bar of the browser and hit enter, it will take me to google.
However, memorizing those numbers is really hard, and therefore some smart people invented DNS servers (Domain Name Servers). Those are computers whose job is to map an IP address to a URL, so it is like a table that contains a lot of information about IP addresses, so there is an entry three for google for example. Now, when you type google.com in your address bar, the address is taken to the DNS server, and the corresponding IP address is returned and your browser is taken to that site.
Now, the hosts file is used for to create a similar table to contain IP/name information. I use it on my local network to give names to cumputers, so inested of saying go to computer 192.168.0.001, I would say go to computer “barcelona” or computer “toronto” depending on how I name it.
Hope this helps, cheers.