Block Any Website?

WyattWhiteEagle

Member
Member
VIP
Local time
9:56 AM
Messages
166
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 Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E1-532
OS
Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Celeron(R) 2957U @ 1.40GHz
Motherboard
Acer EA50_HW
Memory
8.00 GB
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
High Definition Audio Device
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MQ01ABD100 ATA Device
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 Computer

Computer type
PC/Desktop
OS
win 8 32 bit
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
self build
OS
Windows 7 Pro x64 sp1
CPU
i7 4770K
Motherboard
MSI B85M-E45
Memory
8GB Corsair Vengeance 1600MHz
Graphics Card(s)
onboard
Monitor(s) Displays
LG 27MP35
Screen Resolution
1920-1080
Hard Drives
Seagate 2TB
PSU
Cooler Master GX 750
Case
Antec 300
Cooling
Seidon 120V
Internet Speed
60/18
Antivirus
MSE
Browser
Firefox
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).


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 Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
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 Computer

Computer type
PC/Desktop
OS
Windows 7 x64, Vista x64, 8.1 smartphone
CPU
Intel E8400 65W 64-bit
Motherboard
Gigabyte EP45-UD3LR
Memory
DDR2 2 x 2GB, 1GB x 2
Graphics Card(s)
XFX Radeon HD5750
Sound Card
AMD High Definition Audio; Realtek High Definition Audio
Monitor(s) Displays
iiyama prolite X2377HDS
Screen Resolution
1920 x 1080
Hard Drives
500GB 7200 rpm Seagate ST3500413AS 16MB, 500GB 5400 rpm Toshiba MQ02ABF050H 32MB, 200GB 7200 rpm Seagate ST3200820AS 8MB, 2TB 7200 rpm Western Digital WD20EZRX 64MB
PSU
Enermax Liberty Modular
Case
Antec P193 Midi Tower
Keyboard
Mionix ZIBAL 60
Mouse
Razer USB 2.0 Diamondback Mouse or Huion Graphics Tablet
Browser
Internet Explorer, Lunascape, Firefox, Opera, Avast Safezone
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/

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/

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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Compac
OS
Microsoft Windows 7 Ultimate 32-bit 7601
CPU
Intel(R) Pentium(R) Dual CPU E2160 @ 1.80GHz
Motherboard
MSI Boston
Memory
4.00 GB
Graphics Card(s)
(1) VNC Mirror Driver (2) Intel(R) G33/G31 Express Chipset
Sound Card
Disabled
Monitor(s) Displays
Headless
Screen Resolution
1280 x 960 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
ST3320820AS ATA Device
Keyboard
Headless
Mouse
Headless
Antivirus
Malwarebytes pro
Other Info
Also
Windows 8.1 Laptop and Desktop both Acer
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

Will open DNS ask me if I wish to continue?

If so, How do I configure my settings to use open DNS?
 
Last edited:

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Acer Aspire E1-532
OS
Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
CPU
Intel(R) Celeron(R) 2957U @ 1.40GHz
Motherboard
Acer EA50_HW
Memory
8.00 GB
Graphics Card(s)
Intel(R) HD Graphics
Sound Card
High Definition Audio Device
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
TOSHIBA MQ01ABD100 ATA Device

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
medionl/Aspire 6930G/acer x55a
OS
W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
CPU
E5300 dual core
Motherboard
medion MS7366
Memory
3gb
Graphics Card(s)
Nvidia Geforce 7100 Nforce 630i
Monitor(s) Displays
avixc
Internet Speed
n (isp resticted to 72)
Antivirus
mse/pands
Browser
palemoon
Other Info
Belkin Fd7050 n USB using Railink RT2870 drivers, more upto date
Back
Top