Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Block Any Website?

13 Apr 2018   #1
WyattWhiteEagle

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
Block Any Website?

In C:\Windows\System32\Drivers\etc\hosts

What is the prefix configuration for when there are more than 9 websites?

Example:
# 127.0.0.1 localhost
# ::1 localhost
# 127.0.0.2 http://www.-----.com
# 127.0.0.3 http://www.-----.net

and so on to...

# 127.0.0.9 http://www.-----.com

Um...what abt website 10...is it 127.0.1.0 or is it 127.0.0.10 or what?

How about website 100 and website 1,000 and so forth?


My System SpecsSystem Spec
.
14 Apr 2018   #2
samuria

win 8 32 bit
 
 

Spybot used to do this with 15,000 entries which slowed the PC to a crawl there is no point in doing this as it changes daily and it doesn't stop anything using the IP instead of the name. Using open DNS will block dangerous sites without any changes to your pc
My System SpecsSystem Spec
14 Apr 2018   #3
badcrc

Windows 7 Pro x64 sp1
 
 

Quote   Quote: Originally Posted by WyattWhiteEagle View Post
In C:\Windows\System32\Drivers\etc\hosts

What is the prefix configuration for when there are more than 9 websites?
All entries in Hosts should point to 'home' 127.0.0.1 eg

127.0.0.1 http://www.somesite.com
127.0.0.1 http://www.someothersite.com
127.0.0.1 etc

anything on the RHS is resolved to 127.0.0.1

BTW don't use # - that means 'comment out', so the info in the Hosts file preceded with # is ignored.

Using hash # to 'comment out' is common in programming eg in Python

# get initial values
a = 1
b = 2

# program start
a = b * 3
My System SpecsSystem Spec
.

14 Apr 2018   #4
Alejandro85

Windows 7 Ultimate x64
 
 

The initial "numbering" is actually the IP address to which the domain name is pointed to, there is no numeration actually.
For blocking unwanted hosts, any local IP will do, common practice is to put them all to 127.0.0.1, but really anything begining with 127 will do (the whole class A segment 127.x.x.x is assigned to be the local computer, not just 127.0.0.1).


Quote   Quote: Originally Posted by samuria View Post
Spybot used to do this with 15,000 entries which slowed the PC to a crawl there is no point in doing this as it changes daily and it doesn't stop anything using the IP instead of the name. Using open DNS will block dangerous sites without any changes to your pc
The slowdown is due to the initialization of the DNS client cache service with a huge hosts files, which can be easily mitigated by disabling that service.
How do you know that "this changes daily"? We don't know what are those things the OP is blocking. Because of the, suggesting OpenDNS is meaningless unless we know what we're talking about. BTW, OpenDNS "blocking" is as useless at a hosts file block when software uses the IP address, but the hosts files is much faster and generally a vastly superior alternative.
My System SpecsSystem Spec
14 Apr 2018   #5
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

Quote   Quote: Originally Posted by WyattWhiteEagle View Post


Um...what abt website 10...is it 127.0.1.0 or is it 127.0.0.10 or what?

How about website 100 and website 1,000 and so forth?


Each block of an IP address is 8 bits.

So therefore there is an address range from 127.0.0.1 to 127.0.0.255 before you reach address in block 127.0.1.0.
My System SpecsSystem Spec
15 Apr 2018   #6
sml156

Microsoft Windows 7 Ultimate 32-bit 7601
 
 

You do not need the https\\ or http\\ it more than likely will not work as expected.

Code:
EG:
127.0.0.1 google.com
127.0.0.1 example.com
that will block Google but some domains do require the www

Code:
 EG:
127.0.0.1 www.google.com
127.0.0.1 example.com
127.0.0.1 www.example.com
If you want to make it easier on yourself download 2 programs

http://www.abelhadigital.com/hostsman/

Quote:
Built-in hosts file updater

Update your hosts file using the built-in updater. Easily install the latest version of your favourite hosts file.

Custom updater sources

Add your own local or remote sources to the hosts file updater.


HostsMan Editor

Use the built-in editor to edit any hosts file.


Fix errors

HostsMan let's you quickly fix errors, remove duplicates and possible hijacks.


Troubleshooter

HostsMan includes a basic troubleshooter to help identify the most common issues.


Backup manager

Use the built-in backup manager to create copies of your hosts file or quickly restore a previous version.

And

http://www.abelhadigital.com/hostsserver/

Quote:
HostsServer

HostsServer is a local HTTP Server specifically designed to be used with a custom hosts file and is the perfect companion for HostsMan.
My System SpecsSystem Spec
Reply

 Block Any Website?




Thread Tools




Similar help and support threads
Thread Forum
email website links and taskbar pin website defaulting to Chrome
Links to websites, either from emails or from shortcuts pinned to my PC desktop's task-bar have suddenly been directed to Google Chromes search page. There are four icons pinned to the task-bar that work;Windows Media Player, Internet Explorer, Google Chrome, Google Earth and Windows Live Mail all...
Browsers & Mail
Ping DG, ftp block/httpd block
Hello Guys, I find this to be quite embarrassing, having an issue like this that I can't figure out. Here's what I can't do. 1. Ping DG (Default Gateway) 2. Ping my IP (96.46.29.108) 3. Can't access my router via remote, even though its setup to allow it.
Network & Sharing
[Help] need to block a website in windows 7
Hello Brothers and sisters,, Hope you are having a great time,, I have a friend really addicted on a website, and he trying to stop this thing but he could not ! O_o so I planning to block this website in his computer, but i do not want him to know the steps so he can not reverse the...
System Security
Best way to Block a Website
Whats the best way to completely block a Website in it's entirety? More specifically, I want to completely block a PC from accessing Facebook, but only that site.
System Security
How to block a Website in Windows 7
Hi, Can you please let me know how to block a website in Windows 7. I tried this "c:\windows\system32\drivers\etc\hosts" & add the website which i want to block at the end,it is working with XP but not working with 7. Please guide me for the same. Thanks & Regards, Raghs
Browsers & Mail


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:39.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App