how to blacklist host?

Hi! I need to blacklist any incoming/outgoing connections to Google. I need to add filter something like this: google

Hi
In what context just a browser connection or a google bot indexing a website?

To block a browser etc, just add it to the /etc/hosts loopback eg


127.0.0.1 www.google.com
127.0.0.1 www.google.co.nz

For a webste you add robots.txt see here;
The Web Robots Pages

Not only for browser. I want for example ping *.google.com to fail and to get an answer NO SUCH HOST, but not to regirect my own pc. For example, how does /etc/hosts.deny work??? I want all connections to/from google to be blocked, no matter on what protocol it works.

Or is there any good firewall with abbility to block hosts? In YaST there is some firewall, but it’s a total mess, it filters only ports.

It’s just a fronted for iptables. I think You should be able to do what You need configuring iptables manually.

Best regards,
Greg

Aren’t you trying the wrong thing? When you want to block users using hosts in the domain google.com you should not block someone using the names, but the IP addresses. When I do


henk@boven:~> host www.google.com
www.google.com is an alias for www.l.google.com.
www.l.google.com has address 74.125.77.104
www.l.google.com has address 74.125.77.99
www.l.google.com has address 74.125.77.147
www.l.google.com has IPv6 address 2a00:1450:8001::68
henk@boven:~>

What I assume you want is blocking access to all the IP addresses there because the user can allways use the IP addresses in e.g. his browser without ever mentioning the word google.

A small suggestion,
Your question infers (but isn’t necessarily so) that you’re looking for a networking solution that can be applied to more than one host on your network, not just one single machine.

If this is so, then I recommend you look at various proxy server solutions which apply policy on your network’s Internet Gateway rather than on each and every Host. Practically any proxy server likely will do what you ask and much more.

HTH,
Tony