Wednesday, September 30, 2020

Hosts File Junk Filter for a Mac

Take out the trash, don't bring it home.

There are always a small number of people who go out of their way to annoy everyone else.  The result is that state parks, lakes and beaches have much in common with the internet: There is a ton of trash everywhere you go.

You could install an advertisement blocker on your web browser, but those things are usually also spyware in their own way, just less so, than an unprotected network.

A Macintosh is a UNIX machine and it is actually very easy to block most trash on the internet.  Download one of the big hosts files that enumerate most trash sites and save it as file /etc/hosts

Here is a good one, provided by a kind soul: https://someonewhocares.org/hosts/zero/hosts

Instructions and explanations are in there if you are still a bit helpless about this.

It contains lists like this:

0.0.0.0 track.msadcenter.afgz.com

0.0.0.0 track.msadcenter.ajfy.com

0.0.0.0 track.msadcenter.ama.com

0.0.0.0 track.msadcenter.bfy.com

0.0.0.0 track.msadcenter.bvp.com

0.0.0.0 track.msadcenter.cdn.com

0.0.0.0 track.msadcenter.ceio.com

0.0.0.0 track.msadcenter.chpn.com

0.0.0.0 track.msadcenter.cxtv.com

The 0.0.0.0 is an unroutable address and the domain name on the right is the offending party.

You could edit the file and remove a few # signs to activate some more blocks for Microsoft, Google and Double Click, which may affect the operation of some sites which you may never visit anyway and you can also add ones you discover by yourself.

This works, because when the network stack does a Domain Name Lookup, it first looks inside the local hosts file.  If the name is defined there and points to nothing, then the destination becomes unreachable.  

Your internet connection will now work a whole lot faster also, since the requested garbage is simply not downloaded at all.

Simple as that.

Have fun!

Herman

1 comment:

  1. Just put a PiHole on your network - then every device is faster and ad-free :-)

    ReplyDelete

On topic comments are welcome. Junk will be deleted.