EvilZone

General Tech => Networking => : Derric September 25, 2015, 02:01:47 AM

: How could I block a domain from centos? (Don't want server to access the domain)
: Derric September 25, 2015, 02:01:47 AM
I run a small OpenVPN based VPN for my friends, and they are idiots and need to be blocked from a few websites.

How can I block them from accessing say, facebook.com? Like fully block them?
: Re: How could I block a domain from centos? (Don't want server to access the domain)
: Kulverstukas September 25, 2015, 07:22:16 AM
Maybe iptables can help?
http://superuser.com/questions/626813/openvpn-squid-or-another-way-of-blocking-advertisements-websites
: Re: How could I block a domain from centos? (Don't want server to access the domain)
: 0E 800 September 25, 2015, 07:52:44 PM
Pretty sure in /etc/hosts you can specify a specific IP address for a given domain name.
So you can just put a line in there that redirects the site you want to block to the local host.
If you don't want facebook.com or www.facebook.com to go through, you can put these lines in the hosts file:
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com

You might also want to review:
http://unix.stackexchange.com/questions/175621/how-to-block-the-social-websites-in-centos-through-proxy

Please use google search next time: 'centos block website'
: Re: How could I block a domain from centos? (Don't want server to access the domain)
: proxx September 26, 2015, 02:26:02 AM
The DNS null routing is a great idea and works like a charm,   mobile apps use other domains/urls so you gotta make sure you catch all of it, can be a pain.