does the /etc/hosts file work same as the M$ hosts file?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
does the /etc/hosts file work same as the M$ hosts file?
title basicaly said it all. i want to know if i add a large list of spyware sites to my /etc/hosts file will that stop them from getting into my laptop like it does on M$ OS?
Usually you can add the site name and add the IP to be your localhost IP, 127.0.0.1.. which should work as I've done it to site before. Why would you be concerned about spyware sites in Linux though? They usually don't have the capabilities to install and or track you, etc when your using Linux..
Originally posted by Lleb_KCir not worried about spyware on Linux at all, or should i be?
I'm not and never have been, never had a problem. I've never run a virus scanner either, even in Windows I didn't and have yet to get a virus in my 9 years of using computers.. hmmm..
Originally posted by trickykid I'm not and never have been, never had a problem. I've never run a virus scanner either, even in Windows I didn't and have yet to get a virus in my 9 years of using computers.. hmmm..
well as for M$ not getting a virus, you are just lucky. have lost count how many ive had to clean out thanks to my kids or wife.
A few months ago I added a list of ad server URLs to my /etc/hosts file. I edited the hosts file to take the ad server URLs and redirect them to the 127.0.0.1 loopback address on my computer. I did that in the Red Hat 9 Linux hosts file and also in the Windows 2000 hosts file. Afterwards, only about half as many advertisements appeared on most webpages. That solution worked for both Linux and Windows. The missing advertisements now appear as empty rectangles. The telephone lines in my neighborhood are only good for about 26.4 K so with less advertisements the webpages load much more quickly. It made a big difference and the Internet is now much more useable at 26.4 K.
In the /etc directory there is not only the hosts file but also the hosts.allow file and the hosts.deny file. One linux user claimed that I could have just used the hosts.deny file to block those URLs instead of using the hosts file to divert them to the loopback address of my computer. I have not tried that so I do not know if it could be used instead or not. I found a list of what URLs to block on the Mike Skallas' Ad Blocking Hosts file website. He mainly talks about how to block the adds with Windows but he also describes how to do it with Linux/Unix. Here is his website:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.