Ads, and more intrusively, redirects have been a long time issue on FunnyJunk and nearly every other website out there. Today I am going to teach you the best way to fix this shit without installing untrustworthy browser extensions or apps on your phone.
The Secret of a Hosts File
A Brief History *You can skip this if you want
All networked computer and IPV4/6 devics are assigned an IP address within the network that they are on. In the early days of networking a method was designed so Secretary Betsy could access a file on Jimmy Designer's computer without having to remember his computer's IP address of 192.167.43.119
This is what Hosts files were for.
A Hosts file is a simple text file that links an IP address to a specific computer or device name on the network. In the above example, Betsy Secretary only has to remember that to access Jimmy Designers computer on the network, she just has to instead type in the designated name of JimDComp in her address bar to access his computer.
On Betsy Secretary's computer there is a Hosts file that has an entry that looks like...
192.167.43.119 JimDComp
And there is also an entry for every other computer that she should access to within her network that is linked to an IP address inside this Hosts file
For most of you, this sound familiar. If you go to your browser you can just type in 'funnyjunk.com' and you will be taken to it's website. You don't have to know the site's actual IP address because it was given a simple to remember name. These is DNS, or Dynamic Name Server, but it acts much in the same way as Hosts files because a DNS links an easy to remember name to an IP address on the internet. But Hosts files are much more powerful.
Every major Operating System or device that I have encountered can still take advantage of using a Hosts file, including all versions of Windows*, Linux, Android, Mac OS, and likely even IOS. (I am not a Mac user)
Why Use a Hosts File Today You can skip this as well
When you go to your browser and type in funnyjunk.com your computer or mobile first looks to see if there is an entry for funnyjunk.com in its Hosts file. If there is not it will instead look for an entry with your DNS.
Below is the very first entry of a Hosts file, ignoring #Commented lines...
127.0.0.1 localhost
The IP address of 127.0.0.1 is a loopback, or self, IP address and it is assigned to ‘localhost’ which as well means ‘self’. This is very important to us. The reason why this IP address is important to us is because it is ‘localhost’, or ‘self’, your device will INSTANTLY respond with NULL to serve to you. Unless you are hosting a webserver on this device, but if you are doing that then I am likely not teaching you anything new here
Now, even though you are browsing to funnjunk.com or whatever other website, the ads that are displayed on those websites or actually hosted on a completely different IP address. This is an issue! So not only are you loading the information of the website that you desire to browse, you also have to wait the additional time for these ads to be loaded from a completely different location. That can add up to a lot of time and bandwidth from the average user. But on top of that, you can not trust the site that is hosting these ads, many giving redirects to servers that are utilizing the latest Zero Day Exploit. You get malware, spyware, and so much other dangerous shit that goes along with it.
A properly crafted host file can be you best and first line of defense against these bad IP addresses. The reason being is that even though you went to funnyjunk.com, the ads are hosted on evilads.somescamsite.com (not a real example). So when your computer now sees that it needs to get data from another website, your computer/device/mobile will first look to see if there is an entry in your Hosts file, if not then it will ask your DNS.
But lets say that I have an entry in my Hosts file that looks like…
127.0.0.1 evilads.somescamsite.com
When my computer tries to access that evilads.somescamsite.com while browsing funnyjunk.com, my computer will look to see that there is an entry in my Hosts file that is directing my computer to connect to 127.0.0.1, and since I having nothing to host on my computer then it will instantly respond with NULL and nothing will load from that evil server. I will not see an ad and I will not have to fear being redirected. Faster loading times and less bandwidth used.
NOTE: 0.0.0.0 can work as well as an IP address that will return a NULL response in an entry in a Hosts file, your specific OS and other factors may make a difference.
How You Can Use a Hosts File
There are a few websites that host precompiled Hosts files for you to use. Below is my personal trusted ones.
winhelp2002.mvps.org/hosts.txt
someonewhocares.org/hosts
pgl.yoyo.org/as/serverlist.php?showin...
The first one is what I put onto every clients computer. Your computers/devices Hosts file is at the below locations, including the filename.
Windows: //windows/system32/drivers/etc/hosts
Linux, Android, and Mac: //etc/hosts
For Windows, you need administrator access.
For Linux, you will need superuser/root access
For Android, you will need to have your device ‘rooted’**
All in all, as long as you have privileges to access those files then you can continue.
So navigate to the Hosts location of the Hosts file on your device, open it up in a text editor then copy and paste the entries from one or multiple of the sites that I listed above.
Why not use Adblock or Brave...etc
As I mentioned earlier, utilization of a host file is built into the core of every major operating system. And because your operating system looks to this Hosts file whenever trying to make any internet connection, this give your operating sytem a faster response of NULL when a webpage tries to access that site.
Personally, I do not trust those browser extensions much. A few have been paid off to allow connections to specific ad severs, I don’t like installing another thing that eats more resources, it is running on top of so much extra code. And I feel the same way about the Brave browser and similar. I can not trust them. It is more executable crap that needs to be installed that you can never know when they have been bought out.
You can use those browser extensions and other apps and shit in conjunction with using a Hosts file, and that is great and I even do that myself on certain computers, but my first line of defense is my Hosts file.
Are There Alternative?
Yes, With internet connected devices there are always other alternatives. For instance, there are a few DNS’s that are geared towards nullifying traffic from shady sites. I can not personally recommend any as I do not use them, but there are quite a few options.
This option may be simpler for some people as it does not admin, superuser, or root access. But I personally still would rather trust a Hosts file because it the Hosts file is actually on the computer and not needing to contact an outside server for the information.
Other Uses For A Host File
The other main reason why I end up making special entries into Hosts files is when a client is concerned about someone (usually their child) accessing a website that they should not be (usually pornhub) so they ask my to block it on some devices. That type of an entry will look like this in the Hosts file...
127.0.0.1 pornhub.com
127.0.0.1 www.pornhub.com
You can also block facebook, reddit, and any other site that you want to block.
Hell, if you want to, you could make it so that when someone tries to go to google.com they are instead redirected to yahoo.com instead. That type of an entry with Yahoo’s current IP address would look like…
72.30.35.9 google.com
Why Not To Use a Hosts File
I get it, many of you like to support the website that you love. Seeing ads being displayed is only just a minor inconvenience to you. You know it helps admin keep your favorite meme site up an running.
Maybe you don’t have the complete computer understanding to have a custom Hosts file.
This was not meant to be a noobie guide, and if you are further interested then I will try to help in the comments.
Is There an Easier Way?
For Windows users, my fellow computer nerd, Xflak, famous his Wii modding program Modmii created a program called HostsUpdater. This program is a batchfile wrapped in an executable that compiles all the entries from the above listed sites, removes all duplicates, and adds them to the entries of your current Hosts file.
xflak40.wordpress.com/apps/#HostsUpdater
NOTE: You must be able to have admin privileges to execute that program.
Exceptional Notes
*From my understanding is that Windows 10, and maybe even as early as Windows 8, for Microsoft’s telemetry bullshit, those may override any entries in their Hosts file.
**Rooting your android device is beyond the scope of this informational documentation.
***I am not perfect and I may have a few errors in the information that I provided above. Please correct me where needed.
i used to do that with the adaway hosts file made for android on windows