jnelsoninjax Posted April 18, 2019 Share Posted April 18, 2019 I am trying to block a website through the Hosts file, but the site still loads, despite being supposedly redirected to 127.0.0.1. What I have done is put 127.0.0.1 domain name in the hosts file and saved it, I have verified that it is saved, but when I go to the website, it still loads, even after reboot. Am I missing something or doing something wrong? Or is it windows? Link to comment Share on other sites More sharing options...
sagum Posted April 18, 2019 Share Posted April 18, 2019 (edited) 11 minutes ago, jnelsoninjax said: I am trying to block a website through the Hosts file, but the site still loads, despite being supposedly redirected to 127.0.0.1. What I have done is put 127.0.0.1 domain name in the hosts file and saved it, I have verified that it is saved, but when I go to the website, it still loads, even after reboot. Am I missing something or doing something wrong? Or is it windows? You need to ipconfig /flushdns make sure your hosts file hasn't been saved as hosts.txt by mistake as well Mindovermaster 1 Share Link to comment Share on other sites More sharing options...
+BudMan MVC Posted April 18, 2019 MVC Share Posted April 18, 2019 Who does this anymore? Run pihole if your looking to block ###### Or block it on your dns directly with a host override? Do a simple ping does it come back as 127.0.0.1? Also if your browser is using a proxy, doesn't matter what you put in your host file since proxy is what resolves, not the local client. But to your use of host file... Here how to test your setting is working... Keep in mind that hosts file will need admin rights to manipulate... Its also possible your running some antivirus software that prevents manipulation of the hosts file.. And yeah sagum is right, many users will save it has hosts.txt which never used. Circaflex 1 Share Link to comment Share on other sites More sharing options...
Robert_Leo1 Posted April 20, 2019 Share Posted April 20, 2019 If you are trying to block website through host files then make sure that your host's files haven't been saved with wrong names. Link to comment Share on other sites More sharing options...
goretsky Supervisor Posted April 26, 2019 Supervisor Share Posted April 26, 2019 Hello, You need to make sure that you have entered the fully-qualified domain name (FQDN) into the hosts file. For example, if you wanted to block https://www.example.com/ you would want to enter the following lines into the hosts file: 127.0.0.1 example.com 127.0.0.1 www.example.com Note that you do not enter the protocol handler (https, http, ftp, et cetera), just the applicable hostnames. Regards, Aryeh Goretsky Circaflex 1 Share Link to comment Share on other sites More sharing options...
jnelsoninjax Posted April 28, 2019 Author Share Posted April 28, 2019 On 4/25/2019 at 11:37 PM, goretsky said: Hello, You need to make sure that you have entered the fully-qualified domain name (FQDN) into the hosts file. For example, if you wanted to block https://www.example.com/ you would want to enter the following lines into the hosts file: 127.0.0.1 example.com 127.0.0.1 www.example.com Note that you do not enter the protocol handler (https, http, ftp, et cetera), just the applicable hostnames. Regards, Aryeh Goretsky Thanks, I figured it out, and successfully blocked a site as a test using 0.0.0.0 instead of the 127.0.0.1 Link to comment Share on other sites More sharing options...
PaulATMOS Posted April 28, 2019 Share Posted April 28, 2019 Did you work out why the website was still resolving when you had set it to localhost? Link to comment Share on other sites More sharing options...
jnelsoninjax Posted April 28, 2019 Author Share Posted April 28, 2019 14 minutes ago, freqnasty said: Did you work out why the website was still resolving when you had set it to localhost? Never did figure that out, but I did not spend allot of time messing with it. Link to comment Share on other sites More sharing options...
+BudMan MVC Posted April 28, 2019 MVC Share Posted April 28, 2019 There are a bajillion things that could of been reason. Didn't put entries in file correctly saved the file with ext like .txt didn't put in the actual fqdn of what the client was using for whatever site trying to block didn't flush the clients local cache, or even the browsers cache - both of which are different caches browser was using a proxy (dns and or even local host file not used then) etc. etc. etc.. Link to comment Share on other sites More sharing options...
jnelsoninjax Posted April 28, 2019 Author Share Posted April 28, 2019 38 minutes ago, BudMan said: There are a bajillion things that could of been reason. Didn't put entries in file correctly saved the file with ext like .txt didn't put in the actual fqdn of what the client was using for whatever site trying to block didn't flush the clients local cache, or even the browsers cache - both of which are different caches browser was using a proxy (dns and or even local host file not used then) etc. etc. etc.. I agree, that is why I did not spend any time to try and figure out the reason it did not work, and it was only for a test purpose anyway, I was not using it for a permanent solution. Link to comment Share on other sites More sharing options...
Robert_Leo1 Posted July 16, 2019 Share Posted July 16, 2019 On 4/26/2019 at 9:07 AM, goretsky said: Hello, You need to make sure that you have entered the fully-qualified domain name (FQDN) into the hosts file. For example, if you wanted to block https://www.example.com/ you would want to enter the following lines into the hosts file: 127.0.0.1 example.com 127.0.0.1 www.example.com Note that you do not enter the protocol handler (https, http, ftp, et cetera), just the applicable hostnames. Regards, Aryeh Goretsky Thanks for this. It helped me out in more ways than I can share. :) Link to comment Share on other sites More sharing options...
Recommended Posts