Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum https://forum.linuxiarze.pl

Editing hosts file?

Started by PNWDrew, April 30, 2015, 04:53:14 AM

Previous topic - Next topic

PNWDrew

way12go pointed me to http://someonewhocares.org/hosts/ to avoid using adblockers. And of course I have newbie questions about it!

Do I need to retain any of the current content of hosts?  The original lines for localhost are different and I'm not sure what I'm doing if I change them to what is included in the hosts file he linked to.  For the time being I have commented the conflicting lines out.

The original file:
127.0.0.1       localhost
127.0.1.1       debian
# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

New hosts file:
#<localhost>
#127.0.0.1      localhost
#127.0.0.1      localhost.localdomain
#255.255.255.255        broadcasthost
#::1            localhost
#127.0.0.1      local
#fe80::1%lo0    localhost
#</localhost

Thanks for the suggestion way12go

MoroS

For conflicting lines use the lines from the original file. That way, when you have any network (like DNS) issues in the future your configuration won't differ from our own (makes problem solving a little bit less frustrating). ;)
There's no such thing as "impossible". :)

way12go

I don't uncomment anything.

The default hosts file is opened via sudo filemanager ( open hosts  in filemanager )

and then I just add entire text, I don't even bothering not to  copy the uncommented text.

Here is what I do...

The default hosts text-keep it- and in the next line I copy entire text from adblock hosts file.

This is good practice.

You need to update the posted-below text as soon as new hosts-file-text is updated.

The only problem is, you don't get to support sparkylinux as sparkylinux ads are also blocked-and ad frame removed!!!!
Success gives birth to success? Failure gives birth to failure? - Sagar Gorijala.

PNWDrew

Quote from: way12go on May 04, 2015, 09:20:39 AM
I don't uncomment anything.

The default hosts file is opened via sudo filemanager ( open hosts  in filemanager )

and then I just add entire text.

The only problem is, you don't get to support sparkylinux as sparkylinux ads are also blocked-and ad frame removed!!!!

It seems to work well so I'll leave it as is for now. How complex would it be to write a script to check for updates to the list and change the hosts file as needed?

I assume I could find out where the ads here are served from and try removing that source from the list? I'd like to support Sparky in some manner since I was unable to get the donate button to work.

View the most recent posts on the forum