Recommended Posts

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
https://www.neowin.net/forum/topic/1381876-website-blocking-via-hosts-file/
Share on other sites

  On 18/04/2019 at 03:06, 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?

Expand  

You need to ipconfig /flushdns

make sure your hosts file hasn't been saved as hosts.txt by mistake as well

  • Thanks 1

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.

 

 

 

 

hostfile.png

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

  On 26/04/2019 at 03:37, 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

Expand  

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

  On 28/04/2019 at 14:07, freqnasty said:

Did you work out why the website was still resolving when you had set it to localhost?

Expand  

Never did figure that out, but I did not spend allot of time messing with it.

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..

  On 28/04/2019 at 16:13, 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..

Expand  

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.  

  • 2 months later...
  On 26/04/2019 at 03:37, 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

Expand  

Thanks for this. It helped me out in more ways than I can share. :)

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

    • No registered users viewing this page.
  • Posts

    • They are shifting into AI now. Don't you see?
    • Exactly. No need to pay to rent a license. I'd rather own it.
    • Weekend PC Game Deals: Automation fests, Civilization for free, charity specials, and more by Pulasthi Ariyasinghe Weekend PC Game Deals is where the hottest gaming deals from all over the internet are gathered into one place every week for your consumption. So kick back, relax, and hold on to your wallets. The Epic Games Store unlocked a big strategy game giveaway earlier this week: Civilization VI: Platinum Edition. Coming in from Firaxis Games, the turn-based 4X experience has you starting world-conquering campaigns to explore, expand, exploit, and exterminate everything in your empire's reach. PvP and co-op multiplayer are also options if the various forms of AI prove to be too easy or even too troublesome. The Sid Meier’s Civilization VI: Platinum Edition giveaway is live until July 24, and it comes with two massive expansions as well as six DLC packs with extra scenarios, leaders, and more. Next week, tower defense title Legion TD 2 will become the latest freebie on the Epic Games Store. The Humble Store brought a new bundle for action game fans this weekend, and it's all about the Devil May Cry franchise. The Devil Trigger Collection begins with DmC: Devil May Cry and Devil May Cry HD Collection for $10. If you want to complete the bundle, it will set you back $20, which gets you Devil May Cry 4 Special Edition as well as the most recent entry, Devil May Cry 5, as well as its Vergil DLC. This bundle has two weeks left on its counter before it goes away. Big Deals Most publishers are returning to their usual weekend specials after the massive summer sales, so there are plenty of discounts to go around. There's even a special Make a Wish charity sale running on Steam with some discounted viral hits. With all those and more, here's our hand-picked big deals list for the weekend: Satisfactory – $27.99 on Steam Captain of Industry – $24.49 on Steam No Man's Sky – $23.99 on Steam Persona 5 Royal – $23.99 on Steam No More Room in Hell 2 – $22.49 on Steam FOUNDRY – $20.99 on Steam Banishers: Ghosts of New Eden – $19.99 on Steam SULFUR – $19.99 on Steam Assassin's Creed Mirage – $19.99 on Steam Alan Wake 2 – $19.99 on Epic Store Grand Theft Auto V Enhanced – $19.79 on Steam Norland – $19.49 on Steam Stray – $17.99 on Steam V Rising – $17.49 on Steam Dyson Sphere Program – $15.99 on Steam The Outlast Trials – $15.99 on Steam Warhammer 40,000: Darktide – $15.99 on Steam The Outlast Trials – $15.99 on Steam Red Dead Redemption 2 – $14.99 on Steam Turing Complete – $13.99 on Steam Eden Crafters – $13.99 on Steam Core Keeper – $13.99 on Steam Thank Goodness You're Here! – $12.99 on Steam Opus Magnum – $9.99 on Steam Autonauts – $9.99 on Steam EXAPUNKS – $9.99 on Steam DRAGON BALL XENOVERSE 2 – $9.99 on Steam Superliminal – $9.99 on Steam Heaven's Vault – $9.99 on Steam RAILGRADE – $9.89 on Steam Goat Simulator 3 – $9.89 on Steam Tchia – $9.89 on Steam ACE COMBAT 7: SKIES UNKNOWN – $9.59 on Steam PAYDAY 3 – $8.99 on Steam Assassin's Creed Origins – $8.99 on Steam Viewfinder – $8.74 on Steam Escape Academy – $7.99 on Steam Pit People – $7.99 on Steam Skull and Bones – $7.99 on Steam Immortals Fenyx Rising – $7.99 on Steam Imperator: Rome – $7.59 on Steam SHENZHEN I/O – $7.49 on Steam Tom Clancy’s The Division 2 – $7.49 on Steam Bassmaster Fishing – $7.49 on Steam Let's Build a Zoo – $6.99 on Steam The Forgotten City – $6.24 on Steam Control Ultimate Edition – $5.99 on Steam Bramble: The Mountain King – $5.99 on Steam Assassin’s Creed Rogue – $5.99 on Steam RoboCop: Rogue City – $4.99 on Steam Kingdom Two Crowns – $4.99 on Steam Scott Pilgrim vs. The World: The Game – $4.94 on Steam Castle Crashers – $4.49 on Steam BattleBlock Theater – $4.49 on Steam TOEM: A Photo Adventure – $3.99 on Steam Supraland – $3.99 on Steam Vampire Survivors – $3.99 on Steam Darkwood – $3.74 on Steam Valiant Hearts: The Great War – $3.74 on Steam TIS-100 – $3.49 on Steam PAYDAY 2 – $3.29 on Steam Cake Bash – $2.99 on Steam Ragnarock – $1.99 on Steam Alan Wake – $1.49 on Steam Civilization VI Platinum Edition – $0 on Epic Store DRM-free Specials Lastly, here are some highlights from the DRM-free discounts available on the GOG store this weekend: Age of Wonders 4 - $29.99 on GOG Pathfinder: Wrath of the Righteous - Game of the Year Edition - $19.99 on GOG Tomb Raider IV-VI Remastered - $19.49 on GOG The Thaumaturge - $19.24 on GOG Chained Echoes - $13.74 on GOG Tyranny - Gold Edition - $12.49 on GOG Tomb Raider I-III Remastered Starring Lara Croft - $11.99 on GOG Baldur's Gate: Enhanced Edition - $9.99 on GOG Baldur's Gate II: Enhanced Edition - $9.99 on GOG Neverwinter Nights: Enhanced Edition - $9.99 on GOG Old World - $9.99 on GOG Icewind Dale: Enhanced Edition - $9.99 on GOG Neverwinter Nights: Doom of Icewind Dale - $7.99 on GOG Kingdom Come: Deliverance - $5.99 on GOG Might and Magic 6-pack Limited Edition - $4.99 on GOG Heroes of Might and Magic 3: Complete - $4.99 on GOG Blood Omen: Legacy of Kain - $3.49 on GOG Might and Magic 8: Day of the Destroyer™ - $2.99 on GOG Worms Armageddon - $2.99 on GOG ATOM RPG: Post-apocalyptic indie game - $2.99 on GOG Keep in mind that availability and pricing for some deals could vary depending on the region. That's it for our pick of this weekend's PC game deals, and hopefully, some of you have enough self-restraint not to keep adding to your ever-growing backlogs. As always, there are an enormous number of other deals ready and waiting all over the interwebs, as well as on services you may already subscribe to if you comb through them, so keep your eyes open for those, and have a great weekend.
    • Wild that this was even allowed from the jump
  • Recent Achievements

  • Popular Contributors

    1. 1
      +primortal
      498
    2. 2
      ATLien_0
      223
    3. 3
      Michael Scrip
      196
    4. 4
      Xenon
      161
    5. 5
      +FloatingFatMan
      138
  • Tell a friend

    Love Neowin? Tell a friend!