Can't block website.

Joined
Aug 31, 2008
Messages
3
Reaction score
0
Points
1
I used to be able to block access to websites by putting an entries in /etc/hosts like:

127.0.0.1 localhost
# Add for mac
255.255.255.255 broadcasthost
::1 localhost
#In old hosts but not in the MVPS hosts so added 5/16/2008
127.0.0.1 www.facebook.com
127.0.0.1 www.myspace.com

But after a recent software updates the websites are no longer block. I
didn't change the /etc/hosts file.

I'm running OS X 10.4.11 (8S2167) on Intel Core Duo MacBook. The software updates loaded after the sites were no longer blocked where:
Security Update 2008-003 (Intel) (1.0)
Safari (3.1.2)
Security Update 2008-004 (Intel) (1.0)
QuickTime (7.5)
AirPort Extreme Update 2008-002 (1.0)
Security Update 2008-005 (Intel) (1.0)

Help. Thanks.
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
You can block sites with a little terminal trickery and it works on my 10.4.11 and is also much harder to hack

Launch terminal, which can be found in Applications/Utilities.
Check the current hosts file by typing:
cat /etc/hosts

Which should print out the following:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost


Backup the current hosts file to a file named hosts.original by typing:
sudo cp /etc/hosts /etc/hosts.original
Enter your administrator password when prompted.

Copy the current hosts file to the Desktop by typing:
cp /etc/hosts ~/Desktop/hosts.txt

Double click the hosts.txt file that appears on the desktop to open it in TextEdit
Add the Internet address to the end of the file, begin each entry with 0.0.0.0:
0.0.0.0 ads.adsonar.com
0.0.0.0 js.adsonar.com

Add similar lines for any additional domains you wish to block.
Select File->Save

Copy the edited file back into the /etc directory by typing the following:
sudo cp ~/Desktop/hosts.txt /etc/hosts
(Note: There is no ".txt" extension on /etc/hosts)

Verify that the changes were made properly by again typing:
cat /etc/hosts
 
OP
J
Joined
Aug 31, 2008
Messages
3
Reaction score
0
Points
1
Tried this:

127.0.0.1 localhost
# Add for mac
255.255.255.255 broadcasthost
#::1 localhost
#In old hosts but not in the MVPS hosts so added 5/16/2008
0.0.0.0 www.facebook.com
0.0.0.0 www.myspace.com

and restarted the OS, but the websites are still not being blocked.
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
The only difference I can see is

#::1 localhost

try taking the hash out

heres mine

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

0.0.0.0 www.facebook.com
 
OP
J
Joined
Aug 31, 2008
Messages
3
Reaction score
0
Points
1
127.0.0.1 localhost
# Add for mac
255.255.255.255 broadcasthost
::1 localhost
#In old hosts but not in the MVPS hosts so added 5/16/2008
0.0.0.0 www.facebook.com
0.0.0.0 www.myspace.com

Tried it, but sites are still not blocked.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top