We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

How do I remove/disable entry in HOSTS file?

Hi,

Stupid question, really: how do I, temporarily or permanently, disable an entry in my MVPS HOSTS file?

I'm no longer able to access a site which, as far as I'm aware, is perfectly safe, but has just been blocked by my newly-installed HOSTS file.

I've found the 866 KB file (with the file type of, simply, "File") in C:\WINDOWS\system32\drivers\etc, opened it with Notepad and am aware I should put a "#" symbol in front of the entry I want to disable, but don't know what file type to save the new file as.

The two options are: "Text" or "All Files".

Do I keep the encoding as "ANSI"?

I don't want to create any more problems.

Can anyone help?

Comments

  • fwor
    fwor Posts: 6,943 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    It sounds like you're trying to save the file using "Save As..." rather than "Save". If you use the latter instead it will just replace the orginal Hosts file without any further questions. Close Notepad, job done.

    If you're worried that you might need to undo the changes, create a copy called hosts.bak before you start editing it, so that you have a backup if needed for future reference.
  • adaadat
    adaadat Posts: 260 Forumite
    Hi,

    I closed all open IE windows and tried the "Save" option but was told:

    "Cannot create the C:\WINDOWS\system32\drivers\etc\HOSTS file.
    Make sure the path and file name are correct."

    I have to choose "Save As...", for some reason.

    However, no matter which "Save as type" option I choose, either "Text" or "All files", the file is saved as a "Text" file.

    How can I replace the existing HOSTS file with a file of the same file type, whatever it is?
  • John_Gray
    John_Gray Posts: 5,847 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    It doesn't have a file extension - it is simply hosts
    It comes from Unix.

    In NOTEPAD, try saving it as hosts. (Yes, with a full stop after the final s).
    And make the Save As type "All Files", not "Text Documents (.txt)"
  • jaydeeuk1
    jaydeeuk1 Posts: 7,714 Forumite
    Debt-free and Proud!
    And right click on the file, click properties and make sure it isn't read only.
  • adaadat
    adaadat Posts: 260 Forumite
    Hi, John,

    I've tried your suggestion of "HOSTS.", but I'm told:

    "This file exists with Read Only attributes.
    Please use a different file name."
  • Can you not just rename the original hosts file to a different name eg hosts2. That way it no longer exists. You could then try and save the new file as hosts and see if that works.
    Keep thinking positively
  • John_Gray
    John_Gray Posts: 5,847 Forumite
    Part of the Furniture 1,000 Posts Name Dropper Photogenic
    adaadat wrote: »
    Hi, John,
    I've tried your suggestion of "HOSTS.", but I'm told:
    "This file exists with Read Only attributes.
    Please use a different file name."

    Take off the Read-Only attribute before saving the file, and put it on afterwards (if you want).

    Either do this with Windows Explorer
    or in a command prompt window do
    attrib -r \windows\system32\drivers\etc\host
  • adaadat
    adaadat Posts: 260 Forumite
    Thanks, everyone.

    Removing the "Read Only" attribute was what I needed to do.

    I can now simply "Save" the modified HOSTS file and access the site previously denied to me.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.2K Reduce Debt & Boost Income
  • 455.1K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 603K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.