EvilZone

General Tech => Networking => Topic started by: Derric on September 25, 2015, 02:01:47 AM

Title: How could I block a domain from centos? (Don't want server to access the domain)
Post by: Derric on 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?
Title: Re: How could I block a domain from centos? (Don't want server to access the domain)
Post by: Kulverstukas on 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
Title: Re: How could I block a domain from centos? (Don't want server to access the domain)
Post by: 0E 800 on 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'
Title: Re: How could I block a domain from centos? (Don't want server to access the domain)
Post by: proxx on 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.