Skip to main content

Ad blocking without browser extensions

Google is an advertising company first and foremost, lest we forget. They want to create ads people want to see, they say, but I find it hard to trust their motives. It comes as little surprise they want to clamp down on browser extension based adblockers as Ars recently covered.

Fortunately, there are other ways to block ads which are more effective anyway. Every OS has a hosts file, which is simply a plain text file that can route internet traffic from one host to another. In Linux and Mac OS X the hosts file is in /etc/hosts and in Windows it is in C:\Windows\System32\Drivers\etc\hosts and editing it will require sudo or Administrator rights.

Once you have your hosts file open, we are going to add a bunch of entries to it that will take traffic from many thousand known ad-serving domains and route it to which is equivalent to a digital trash can. There are options for host file ad blocking. Personally, I use the list from but the list from Steven Black looks even more comprehensive, and it is segregated out into the types of traffic you would like to block: unified hosts for ads, fake news, gambling, porn and social. Both of these lists are completely free of charge. What you want to do is get your list loaded into your browser, then select all and copy it to the clipboard. Next, simply paste the text into your hosts file. You may want to take a backup of the hosts file first, especially if you have existing entries that you will need to add back in. Once this is done, ad blocking will immediately take effect, no reboot or logout required.

Supposed you are on a device which does not allow access to the hosts file, like your phone or tablet. Sure, there are plenty of ad blocking apps which you could use, but I have found a better way. On your device you can change the DNS settings for WiFi connections. A simple google search will show you how to do this on iOS or Android. Armed with the knowledge of how to change this setting, you will need a primary and a secondary DNS server. There are several free DNS servers to use AdGuard is quite reliable and Alternate DNS has not failed me yet. In my setup, I use my primary server from one and secondary from another, just to keep them honest although this is not necessary.

In changing the DNS, we are still trusting someone else with our internet traffic and DNS hijacking is a real threat. How do we know our DNS server settings aren't being compromised? I use a router checker from F-Secure to verify the DNS settings. This tool is also free, and entirely online. It will give you an expanded view of your DNS settings if you wish, and its standard output is a simple Green/OK Red/NotOK. So there you have it, a completely free way to block ads, without relying on the browsers to not undercut their own business model!

What about when you're on the cellular networks from you phone or tablet, you ask? I have that figured out as well, but I'll save that for another day...

--Jay E. blogging for


Popular posts from this blog

The Evolution Of Tech Culture

Photo by Skitterphoto The culture associated with technology has a checkered past but maybe not in the way you think. Before it became socially acceptable to tote your pocket supercomputer around, why was technology culture anti-social? Are we more social now, or less? Ars Technica recently interviewed Clive Thompson for his upcoming book  Coders: The Making of a New Tribe and the Remaking of the World .Thompson specifically focuses on the origins of the culture of programmers, and there are some interesting divergences from the culture as it is today. Traditionally, software programmers are stereotyped but Thompson debunks these myths. Rather than being purely anti-social, programmers are merely intensely focused problem solvers. Programmers will spend many hours trying to fix something, which can be frustrating, but they are a rare breed equipped to handle frustration. Programmers solve hard problems, despite frustration, because this is what they enjoy doing. There is a cos

On Homelessness

Photo by Quaz Amir It started yesterday, after work as I left my building, I saw them walking. A couple, hauling their belongings in a few neatly stacked boxes that looked like tackle boxes tied to a small luggage cart. The man had crossed the street, along with his dog who stayed faithfully by his side. An older woman was stuck at the intersection waiting for cars to stop. Before long, the cars did stop, she joined her partner, and I didn't spend much more time thinking about them that day. At my job today, I had a great morning. A coworker gave me a great idea for a quick but useful project, which I was able to finish before noon. I feel I am at my best when I am able to be productive. It gives me a sense of purpose for lack of a better word. Feeling good about myself, I set out to buy myself a hamburger for lunch and skip the more healthy option that I brought from home. I drove the short distance to the hamburger joint, the epitome of laziness. As I drove up, I saw the

Workplace Privacy

Photo by Philipp Birmes Americans who believe that our rights are unalienable would be surprised to learn how limited in scope they are at their place of employment. At work, our liberties are second to the need for business to monitor their assets, including their greatest asset, their people. While it is not unreasonable for businesses to be secure, they must tread carefully to avoid violating the rights of their employees. The story of Theranos, the now defunct blood testing company which has since been revealed to be a total fraud, is not new, but many new details are now emerging. Theranos was a silicon valley wunderkind because it was poised to revolutionize the blood testing industry under the leadership of its charismatic leader, Elizabeth Holmes. Holmes made many unethical business decisions, but how was this massive fraud initially discovered? One detail about Theranos that has recently emerged is how paranoid senior leadership was. Holmes had made a connection to a f