Author Topic: How could I block a domain from centos? (Don't want server to access the domain)  (Read 682 times)

0 Members and 1 Guest are viewing this topic.

Offline Derric

  • /dev/null
  • *
  • Posts: 6
  • Cookies: 0
    • View Profile
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?

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog

Offline 0E 800

  • Not a VIP
  • VIP
  • Baron
  • *
  • Posts: 895
  • Cookies: 131
  • • тнε ιηтεяηεт ιs мү яεcүcℓε-вιη •
    • View Profile
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'
« Last Edit: September 25, 2015, 07:54:32 pm by 0E 800 »
The invariable mark of wisdom is to see the miraculous in the common.

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
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.


« Last Edit: September 26, 2015, 02:27:13 am by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage