Can you allow users to view specific web sites with the terminal?

in macOS edited January 2014
I've read that you can block your computer from going to specific web sites

by using the terminal to type in the blocked web sites and run some command.

Can you also use the terminal to type in a set of web sites that you only want to allow? In other words, while I'm not home, I only want a user to be allowed to visit say,, the weather channel, and Can I use the terminal to only let the computer visit these 3 sites and block ALL other sites or can you only type in the sites you want to block?

If you can type in a list of sites to visit only, can you set it up for a user so that when the computer is shut down and then turned on again later, these allowed sites are always set?

Thanks in advance to all who answer or comment...


  • Reply 1 of 2
    dobbydobby Posts: 797member
    Open Terminal

    $ host (to lookup ip for

    $ ipfw add deny all from to being the ip of the machine your on

    $ ipfw list

    use this to see the rules

    $ ipfw delete 100 200 300 400

    deletes rules 100 200 ...

    $ you don't actually need to do the host lookup as you can also enter

    $ ipfw add deny all from to

    Cool huh!

    BTW ESPN has a swag of other sites such as (or something) so you will probably need to block these as well.

    Hope this helps.

  • Reply 2 of 2
    dobbydobby Posts: 797member
    Sorry, I'll retype that answer after reading the question again properly.

    open Terminal

    $ ipfw add 10000 deny ip from any to

    the 10000 is the row number as firewalls process rules on order of preference.

    $ ipfw add 100 allow ip from ip_address_of_espn to

    increment the row number 100 when adding further ips.

Sign In or Register to comment.