betweenGo

Windows hosts file not working

by on Aug.10, 2005, under Windows

On Windows you can manually match hostnames to IP addresses using the hosts file located in C:\WINDOWS\system32\drivers\etc. An example of a hosts file:

127.0.0.1       localhost
#10.22.1.18     foo foo.bar.ca
16.17.18.19     toronto
16.17.18.125    boston

If you find that the contents of the hosts file are not being picked up by Windows it might be because the file is corrupted though the corruption is not evident in your editor. The best thing to do is to delete or move that file and create a brand new hosts file and hopefully the contents of this hosts file will be picked up by Windows.

Share

Related posts:

  1. HOWTO: Disable Windows Error Reporting?
  2. Unable to start Cygwin shell from Windows command prompt
  3. Microsoft Windows Vista Error 0×80070091 and Cygwin
  4. Shell Scripts with Windows LF’s Fail in Latest Cygwin
  5. Turning off Perforce Windows Explorer Integration


9 Comments for this entry

  • Keith Carangelo

    Holy smokes, this worked great for me. Thank you!

  • Lucio

    Yes Sir, thank you very much

  • kps

    This works !!!!!!!!! , just copy paste the hosta file,ctrl+A remove all the content and write wt u want , clear cache if you are using IE ‘Done’

  • KRS1

    Worked for me, many thanks!

  • Brian DiChiara

    Thanks so much for posting it, it helped me a million!

  • Nigel Boulton

    Worked for me too – thanks!

  • grand

    !!!!!!!!!!!!

    Another reason is incorrect file access security settings. (maybe because file-recreation, 3rd party programs access etc.)

    re-creating hosts file did not solved my problem.

    here is another working solution
    right clicked hosts file
    open “security” tab
    make sure that the users/groups “SYSTEM”, “Administrators”, “Users”(read only access) are there; add them if they are not there.

    now Windows reads and obeys the hosts file!

    (I have tested on xp, I was an administrator but “Users” was not there and windows was not reading the hosts file)

  • grand

    In addition to my previous comment:

    re-creating the file not worked for me because I have re-created the file on my desktop and copied to its location. But since it is my desktop, “Users” are not added to access security settings.

    Nevertheless, we can check file security settings, before trying to re-create it IMHO.

  • Jones

    Hi Grand,

    Thanks for the suggestion. It worked for me.

    Regards.
    Jones

Leave a Reply

 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!