My host file is not working on Windows 10

This is crazy, I've never has this issue until now...I like to use the hosts file to block certain websites. But for some reason my hosts file is not blocking any website. I went over this post (Hosts File not working correctly) and tried most if not all of those things but I'm still not able to use my hosts file to block websites. Anything else I can do to fix this? I've used hosts files for years and never had this issue.

Note: I just got this PC (refurbished) so maybe they created some weird settings before shipping it? I wouldn't think so but figured I'd mention it.

Here is how I have my hosts file entries...maybe I"m missing something?

127.0.0.1 localhost
127.0.0.1 website.com
127.0.0.1
127.0.0.1 website2.com
127.0.0.1 
4

3 Answers

Just changing the hosts file is not enough. You also need to flush your DNS cache.

Open a command prompt and type:

ipconfig /flushdns

Now, test if it works by pinging one of the domains, preferably one you changed recently:

ping 

and see if it returns the 127.0.0.1

If the ping does not work, then it is likely that the permissions on the hostfile are incorrect. Incorrect permissions on the hostfile may cause an arbitrary lock on the hostsfile which prevents windows from properly read it and populating the dns cache. Fix the permissions on the hostfile then perform an ipconfig /flushdns once more.

If the ping works, but the website does not load correctly, then the website is still loading from cache. Clear your browsercache to fix the issue.

3

Weird, there must have been something wrong with that particular hosts file, I still have no idea what it was...

I went over to: and followed the steps for replacing the hosts file then I manually put in my websites now it's working. Earlier, I tried to copy and paste the host file content from the above URL but that didn't work. Anyways, no more issues!

1

You need to add your loopback address as primary DNS in order to be able to read from the host file.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like