4/28/2015 - 4:15 PM

Block domains and IPs on macos

Block domains and IPs on macos

1. Add a rule to the current ipfw table
sudo sudo ipfw add 70000 deny tcp from any to

set port to port 80 if ouy just want to block HTTP


2.use a DNS service to block many things

Hint: Set your DNS servers to use your routers IP address, and then  configure which DNS servers to use over there. That means you won't have to reconfigure every single device on your network, but instead they populate via DHCP and you can easily change the DNS relay depending on your needs.

Tutorial for macos yosemite:

3. Add a rule to etc/hosts
sudo pico /etc/hosts or sudo nano /etc/hosts
add domains:

You can use a fake ip or lookup any other ip (nslookup and add it 
sudo dscacheutil -flushcache