Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How do you block websites via the terminal in OS X?

How do you block websites via the terminal in OS X?
Thread Tools
Forum Regular
Join Date: Aug 2002
Location: Southern Ca.
Status: Offline
Reply With Quote
Mar 10, 2004, 11:02 PM
 
A while back, I read somewhere that you can manually type in websites in the terminal that could be set up so that your mac can't go to these sites. Does anybody know what the command or commands are?

Thanks to all who answer.

- Mark
     
JNI
Forum Regular
Join Date: Oct 2002
Location: Left Coast
Status: Offline
Reply With Quote
Mar 10, 2004, 11:15 PM
 
Originally posted by sc_markt:
A while back, I read somewhere that you can manually type in websites in the terminal that could be set up so that your mac can't go to these sites. Does anybody know what the command or commands are?

Thanks to all who answer.

- Mark
Though I've never done it, I believe this can be done using ifpw. See man ipfw - there are examples of blocking certain sites.

I think there are a few GUI apps out there as frontends for ipfw. You might want to google for something like that to make your life easier.
     
Mac Elite
Join Date: May 2001
Status: Offline
Reply With Quote
Mar 11, 2004, 01:05 AM
 
     
Mac Elite
Join Date: Sep 2000
Location: Edmond, OK USA
Status: Offline
Reply With Quote
Mar 11, 2004, 10:42 AM
 
Originally posted by JNI:
Though I've never done it, I believe this can be done using ifpw. See man ipfw - there are examples of blocking certain sites.
Be warned that once you use ipfw to modify the rules that the Firewall control panel will cease to function (until you put it back).
     
Dedicated MacNNer
Join Date: Sep 2003
Location: Pittsburgh, Pennsylvania
Status: Offline
Reply With Quote
Mar 12, 2004, 12:23 AM
 
You could also do it in your /etc/hosts.deny file

When encountering a site the computer first looks at this file, if the site, or ip address is in this list your computer will not go there. Ipfw will work at blocking sites, but this is much easier if you do not have a firm grasp of the unix underpinnings of the computer.

ndt
Apple iBook, B&W, Quadra 660, PowerMac 6100
Sun Netra T1, Ultra 1, Javastation
http://natetobik.mine.nu:81
     
Mac Elite
Join Date: Jun 2000
Status: Offline
Reply With Quote
Mar 25, 2004, 07:07 PM
 
Originally posted by Partisan01:
You could also do it in your /etc/hosts.deny file
I could be wrong but If I understand it correctly, hosts.deny would only block inbound connections. What I used to do on NetBSD is modify /etc/hosts and add an entry such as:

yahoo.com 127.0.0.1

This should prevent Yahoo from coming up, assuming your computer uses the hosts file before looking in DNS.
Agent69
     
Dedicated MacNNer
Join Date: Sep 2003
Location: Pittsburgh, Pennsylvania
Status: Offline
Reply With Quote
Mar 27, 2004, 01:00 PM
 
Originally posted by Agent69:
I could be wrong but If I understand it correctly, hosts.deny would only block inbound connections. What I used to do on NetBSD is modify /etc/hosts and add an entry such as:

yahoo.com 127.0.0.1

This should prevent Yahoo from coming up, assuming your computer uses the hosts file before looking in DNS.

Yeah, I think you're correct on that one. Thanks for the correction.

nt
Apple iBook, B&W, Quadra 660, PowerMac 6100
Sun Netra T1, Ultra 1, Javastation
http://natetobik.mine.nu:81
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:05 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2