Trying to block a site using hosts file in windows 10, but it's not blocking


Recommended Posts

I am attempting to block a website using the hosts file in win10. I am using the format 127.0.0.1 site.name (does it mater if it's just domain.com does it need the http in front?), saving it (using notepad w/ admin privileges) and then double checking the file. I have even reset the system and it still seems to just ignore the fact that the site in question is blocked. Am I doing something incorrect, or is there something else that needs to be done?

  • Like 1
  On 16/01/2017 at 21:57, jnelsoninjax said:

I am attempting to block a website using the hosts file in win10. I am using the format 127.0.0.1 site.name, saving it (using notepad w/ admin privileges) and then double checking the file. I have even reset the system and it still seems to just ignore the fact that the site in question is blocked. Am I doing something incorrect, or is there something else that needs to be done?

Expand  

What browser are you testing this with?

Instead of 127.0.0.1, try 0.0.0.0. I currently use https://github.com/StevenBlack/hosts to filter traffic, an thats what they use. Hope it helps

  On 16/01/2017 at 22:03, kurupy said:

Instead of 127.0.0.1, try 0.0.0.0. I currently use https://github.com/StevenBlack/hosts to filter traffic, an thats what they use. Hope it helps

Expand  

I tried the 0.0.0.0 as well, I noticed that address was in the hosts file already from another program, and I tried replicating that as well, at this point IDK if the issue is that the site is cached and FF is loading the cached version or if there's something else going on.

  • Like 1
  On 16/01/2017 at 22:06, jnelsoninjax said:

I tried the 0.0.0.0 as well, I noticed that address was in the hosts file already from another program, and I tried replicating that as well, at this point IDK if the issue is that the site is cached and FF is loading the cached version or if there's something else going on.

Expand  

Try clearing the cache and attempt to visit the website again.

  On 16/01/2017 at 22:08, Circaflex said:

Try clearing the cache and attempt to visit the website again.

Expand  

No effect. Site still loads just fine. Also just a FYI the FF has no extensions installed, so there is no conflict there.

  • Like 1
  On 16/01/2017 at 22:08, sc302 said:

If I wanted to block google with a host file this is what I would do


127.0.0.1 google.com


Sent from my iPhone using Tapatalk

Expand  

That is exactly how I have it setup: 127.0.0.1 website.com I also have it as 0.0.0.0 website.com

  • Like 1
  On 16/01/2017 at 22:17, exotoxic said:

Did you try cleaning the DNS cache?

cmd --> ipconfig /flushdns

Expand  

Had not thought about that, I give it a go.

  • Like 1
  On 16/01/2017 at 22:18, jnelsoninjax said:

Had not thought about that, I give it a go.

Expand  

Again, nothing.

Tried in Edge, still goes through

  • Like 1

Why not use opendns or some other block to block the sites you don't want them or yourself to visit. There are far better solutions than to use a host file.


Sent from my iPhone using Tapatalk

  On 16/01/2017 at 22:25, Circaflex said:

Random thought, but have you tried rebooting after making the edits and attempting to visit the webpage?

Expand  

Not every time, but after initial change I rebooted the machine.

So far I have 1) Cleared the Cache 2)Flushed the DNS 3) Removed all cookies.

@sc302, I am going to do that now! I realized just as you said it that I have the router configured to use OpenDNS and Google's DNS as well, I check which one is the primary (hopefully OpenDNS)

  • Like 1
  On 16/01/2017 at 23:10, sc302 said:

If you create an account with opendns, you will be able to add your site/house/home internet and block access by category or by site name.  It is free to setup.

Expand  

Well it turns out that there is no way to set the router (Linksys WRT1900AC) to use OpenDNS, it will always default to the ISP's DNS server, which is asinine, but after some extensive research I have determined that to be the case for this router, at least until I install and open source firmware on it.

  • Like 1
  On 17/01/2017 at 00:29, jnelsoninjax said:

Well it turns out that there is no way to set the router (Linksys WRT1900AC) to use OpenDNS, it will always default to the ISP's DNS server, which is asinine, but after some extensive research I have determined that to be the case for this router, at least until I install and open source firmware on it.

Expand  

I assume you are using a static IP if that is the case? If it is dynamic, yu can use a different DNS. You do that by providing the OpenDNS IPs in the DHCP Server settings on the Local Network tab of the Connectivity page.

 

 

they also have a config page here for that router https://support.opendns.com/hc/en-us/articles/228008007-Configuration-for-Linksys-Cisco-AC175-EA6300-EA6500-EA6900-WRT1900AC

  On 17/01/2017 at 00:29, jnelsoninjax said:

Well it turns out that there is no way to set the router (Linksys WRT1900AC) to use OpenDNS, it will always default to the ISP's DNS server, which is asinine, but after some extensive research I have determined that to be the case for this router, at least until I install and open source firmware on it.

Expand  

you are looking in the wrong place.  change the dns to point to opendns in the below screenshot.

 

some give you the opportunity to change it in the internet setting tab (or whatever the equivalent terminology is in the different hardware manufacturers gui), others you change it in the local area connection, LAN or DHCP location). 

 

 

1.jpg

  On 17/01/2017 at 01:14, Circaflex said:

I assume you are using a static IP if that is the case? If it is dynamic, yu can use a different DNS. You do that by providing the OpenDNS IPs in the DHCP Server settings on the Local Network tab of the Connectivity page.

 

 

they also have a config page here for that router https://support.opendns.com/hc/en-us/articles/228008007-Configuration-for-Linksys-Cisco-AC175-EA6300-EA6500-EA6900-WRT1900AC

Expand  

Thanks for that info!

  On 17/01/2017 at 02:23, sc302 said:

you are looking in the wrong place.  change the dns to point to opendns in the below screenshot.

 

some give you the opportunity to change it in the internet setting tab (or whatever the equivalent terminology is in the different hardware manufacturers gui), others you change it in the local area connection, LAN or DHCP location). 

 

 

1.jpg

Expand  

You're correct, I was reading/looking in the wrong spot on the config page!

  • Like 1

Success! I finally got it to block the site in question via OpenDNS! Talk about a giant PITA, but I finally got it.

  • Like 3

Did you bother to do a simple test if host file entry was being used?

 

Edit host file as admin, put in your entries and then try and ping..  If this something else has been looked up recently then you would need to flush the cache..

 

This really is clickity clickity stuff.. So couple things - your browser had it cached, using a proxy so it doesn't even ask local system or dns - the proxy gets asked, etc. Your running some antivirus that prevents changes to hosts file sort of thing.. But its like 2 seconds to validate if what your putting in the host file is being used..

hostfile.png

 

blocksite.png

 

You have to make sure what your putting in the host file is what is actually being looked up too..  ie if your not going to say www.google.com then google.com would work, etc.

 

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Microsoft Store is getting improved recommendations, deeper Windows integration, and more by Taras Buria Microsoft announced several new features coming to the Microsoft Store on Windows 11. The company revealed that 250 million customers use the Microsoft Store each month. With the latest updates, Microsoft is improving the experience with better recommendations, search improvements, deeper Windows integration, Copilot, and more. The store's Home Page is getting personalized recommendations with suggestions based on your recent activities, what is trending in your region, and the recent deals. Microsoft says this change will bring more meaningful and relevant content. Search is getting smarter, and it now uses additional information when ranking apps. It is "intent-aware," and considers additional aspects like app updates, ratings, language-specific nuances, and more. In the United States, the Microsoft Store now has a Copilot button at the bottom of the screen. Clicking it lets you ask questions about an app or game, or compare two products. Speaking of Copilot, apps with AI-powered experiences now have a badge indicating that certain apps work better on Copilot+ PCs. Other changes to the Microsoft Store include a new Discover More section with related apps and deeper Windows integration. The latter lets you find apps in the Microsoft Store using Windows Search, and the "Open With" dialog now includes additional recommendations from the Microsoft Store. Finally, Microsoft made multiple under-the-hood improvements to boost performance (the app launches twice as fast as it did six months ago) and improve installation reliability. In addition to new features coming to the Microsoft Store, the company reminded users that some popular productivity apps are now available in the Store. They include Notion, Perplexity, Docker, and Day One. You can read more about all those changes in a post on the official Windows Blogs website. Last month, at Build 2025, Microsoft announced more improvements for the Microsoft Store, so stay tuned for those.
    • OpenAI exposes secret propaganda campaigns tied to multiple countries by David Uzondu Back in February, OpenAI shut down accounts that were busy developing Chinese surveillance tools aimed at the West. These tools were designed to snoop on social media, look for anti-China sentiment and protests, and report back to Chinese authorities. Now, OpenAI has announced it has disrupted even more shady operations, and not just those tied to China. In a report released Thursday, the company detailed how it recently dismantled ten different operations that were misusing its artificial intelligence tools. One of the China-linked groups, which OpenAI called "Sneer Review," used ChatGPT to churn out short comments for sites like TikTok, X, and Facebook. The topics varied, from U.S. politics to criticism of a Taiwanese game, where players work against the Chinese Communist Party. This operation even generated posts and then replied to its own posts to fake real discussions. What is particularly interesting is that the group also used ChatGPT to write internal performance reviews, describing how well they were running their influence campaign. Another operation with ties to China involved individuals posing as journalists and geopolitical analysts. They used ChatGPT to write social media posts and biographies for their fake accounts on X, translate messages from Chinese to English, and analyze data. OpenAI mentioned that this group even analyzed correspondence addressed to a U.S. Senator. On top of that, these actors used OpenAI's models to create marketing materials, basically advertising their services for running fake social media campaigns and recruiting intelligence sources. OpenAI also disrupted operations, probably originating in Russia and Iran. There was also a spam operation from a marketing company in the Philippines, a recruitment scam linked to Cambodia, and a deceptive job campaign that looked like something North Korea might orchestrate. Ben Nimmo, from OpenAI's intelligence team, noted the wide range of tactics and platforms these groups are using. However, he also said these operations were mostly caught early and did not manage to fool large numbers of real people. According to Nimmo, "We didn't generally see these operations getting more engagement because of their use of AI. For these operations, better tools don't necessarily mean better outcomes."
    • Long ago, I was in a networking class on a lab computer. The guy next to sarcastically told me to SHIFT+DELETE the C:\Windows folder. I said that I was sure Windows wouldn't allow such a thing (Windows 2000), and would either totally block the action or give some kind of dire warning. I was so confident that I tried it...not only was I wrong, but it didn't even give the standard "are you sure" warning, just went to town. I pressed cancel as quick as I could, but it was too late, shortly after, the system blue-screened and never booted again. I had to stay late and reinstall Windows for the teacher, but that ended up being a good thing, had great repour with him for the rest of the year, even got to help him get Active Directory setup in his lab.
    • My best decision: SHIFT+DELETE WINDOWS Then Installed Fedora Linux. Now I am a Happy Person
  • Recent Achievements

    • One Year In
      survivor303 earned a badge
      One Year In
    • Week One Done
      jbatch earned a badge
      Week One Done
    • First Post
      Yianis earned a badge
      First Post
    • Rookie
      GTRoberts went up a rank
      Rookie
    • First Post
      James courage Tabla earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      419
    2. 2
      snowy owl
      182
    3. 3
      +FloatingFatMan
      182
    4. 4
      ATLien_0
      176
    5. 5
      Xenon
      137
  • Tell a friend

    Love Neowin? Tell a friend!