LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   does suse 10.0 use a hosts file to block unwanted web sites like windows? (https://www.linuxquestions.org/questions/linux-newbie-8/does-suse-10-0-use-a-hosts-file-to-block-unwanted-web-sites-like-windows-668703/)

sirius57 09-09-2008 12:31 PM

does suse 10.0 use a hosts file to block unwanted web sites like windows?
 
I want to add a hosts file in my suse 10.0 box. I installed a hosts file in winxp to block bad internet sites and want to do the same on my linux box. Also using firefox browser.

TB0ne 09-09-2008 12:51 PM

Quote:

Originally Posted by sirius57 (Post 3274764)
I want to add a hosts file in my suse 10.0 box. I installed a hosts file in winxp to block bad internet sites and want to do the same on my linux box. Also using firefox browser.

SuSE 10.0 is very old...11.0 is the latest. The 'hosts' file is normally used for name resolution, in the event you want to specify a different address for a host, other than the one it gets from DNS (or to keep from using DNS totally...).

If you want to block internet sites, squid and squid-guard can do it.

win32sux 09-09-2008 01:49 PM

Yes, you can do that thing where you make bad domains resolve to 127.0.0.1. Of course, this isn't technically "blocking". Like TB0ne one said, you can use a proxy server to do real blocking.

gymnart 10-30-2008 11:23 AM

I use the hosts file to block some sites on my SuSE 10.0 box too.

The hosts file should be in the /etc folder and you have to be root to edit it. It works the same as the Windows one.

john test 10-30-2008 03:20 PM

ubuntu has hosts, hosts.deny, hosts.allow in the /etc directory.

gymnart 10-30-2008 03:29 PM

Hello john test. :)
SuSE 10.0 has that too. I've just used the plain "hosts" one the same way I use it in Windows.

sirius57 10-30-2008 09:09 PM

Yes, I got it to work by appending the hosts file text to the hosts file. I leave the hosts.allow and hosts.deny alone. I found that the file does block pop ups.

jschiwal 10-30-2008 09:26 PM

You may cause problems if you cut and paste text from a windows text file. Make sure the line endings don't contain both newlines and returns.
They should just use newlines (\n).

You can check it by loading it into vim or running "od -a /etc/hosts". You should see a "nl" character between lines. You can fix a text file running "sudo dos2unix /etc/hosts".

Another thing you can do if you don't have very many IP addresses to block is to add iptables rules blocking ingress or outgress traffic from/to those addresses.


All times are GMT -5. The time now is 12:39 PM.