hosts file and unblocked subdomains

5,821

Solution 1

The hosts file is very basic, and by basic i mean BASIC. You are going to have to do

127.0.0.1 google.com
127.0.0.1 www.google.com
127.0.0.1 wave.google.com
127.0.0.1 docs.google.com

etc

If you are trying to pull a prank, use that, if you want to get serious, you need to invest in a network firewall or some such that will allow you to block domain names.

Solution 2

The hosts file doesn't support wildcards. You will need an ad blocking proxy / DNS program to do that. See e.g. TreeWalk DNS

Share:
5,821

Related videos on Youtube

ilhan
Author by

ilhan

https://www.buymeacoffee.com/ilhan

Updated on September 17, 2022

Comments

  • ilhan
    ilhan almost 2 years

    I modified hosts file to block google.com and its subdomains but it blocks only the main domain name. It does not block the subdomains. Windows 7 Starter

    127.0.0.1 google.com

    It blocks google.com but dows not block www.google.com

    Then I tried this one: 127.0.0.1 *google.com It didn't helped.

    • Admin
      Admin over 14 years
      Why would you want to block Google?
    • Admin
      Admin over 14 years
      It is just an example domain. I do not want to show the real domain here.
    • Maxim Zaslavsky
      Maxim Zaslavsky over 14 years
      Why the downvote? I'm guessing it was before the migration, but just in case, it's a perfectly valid question.
    • Clayton Hughes
      Clayton Hughes almost 14 years
      Maybe edit this to read example.com to stop the freak-out comments?
  • Thalys
    Thalys over 11 years
    windows defender is a windows 8 thing. This question predates it by about 3 years.
  • barej
    barej about 5 years
    And google doubleclick.net knows how to get around that by spamming the subdomains.