Advice Request Block ads using hosts file

Please provide comments and solutions that are helpful to the author of this topic.

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
I would like to block ads in the Steam browser on my PC. The only method I have come up with is via hosts files on Windows.

Systemwide adblock and DNS is not a solution for me.

Is that a good idea? If so, which host file would you recommend?
 

Orchid

Level 1
Jan 27, 2023
44
I have used host files to block ads in the past, but I have never seen host files blocking ads in software applications, so I cannot comment if using a host file is a good idea. However, there is no harm in finding out for yourself. I usd StevenBlack Host File. StevenBlack Host File is consistently updated every week or every couple of days. What I find about the StevenBlack Host File great is you can pick what type of host file/ads you want to block. For instance: there's a host file to block malware ads, social ads, gambling ads, etc., or a combination of one or more host files. If this interests you, the link to StevenBlack Host File is below.

References
StevenBlack Host File
 

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
I have used host files to block ads in the past, but I have never seen host files blocking ads in software applications, so I cannot comment if using a host file is a good idea. However, there is no harm in finding out for yourself. I usd StevenBlack Host File. StevenBlack Host File is consistently updated every week or every couple of days. What I find about the StevenBlack Host File great is you can pick what type of host file/ads you want to block. For instance: there's a host file to block malware ads, social ads, gambling ads, etc., or a combination of one or more host files. If this interests you, the link to StevenBlack Host File is below.

References
StevenBlack Host File
Is it possible to set-up a host file to auto-update?
 

Bot

AI-powered Bot
Apr 21, 2016
4,367
I would like to block ads in the Steam browser on my PC. The only method I have come up with is via hosts files on Windows.

Systemwide adblock and DNS is not a solution for me.

Is that a good idea? If so, which host file would you recommend?
Using the hosts file to block ads is a good idea, and it can be an effective way to block ads on specific websites including the Steam browser. One popular hosts file is MVPS hosts, which is available for free download from the MVPS website.

After downloading the hosts file, you can add it to Windows by copying it to the C:\Windows\System32\drivers\etc folder, and renaming it to "hosts". You may need administrator privileges to do this.

Keep in mind that using a hosts file to block ads is not foolproof and may not block all ads. Additionally, some websites may not function properly if certain advertisements are not loaded. It's always a good idea to backup your hosts file before making any changes to it, so that you can easily restore it to its original state if necessary.
 

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
I'm considering NextDNS. Does it support Quad9 - can I somehow use it with Quad9?
 

SeriousHoax

Level 49
Verified
Top Poster
Well-known
Mar 16, 2019
3,862
I'm considering NextDNS. Does it support Quad9 - can I somehow use it with Quad9?
You can't.
If you don't want to switch your preferred DNS, then setup Adguard Home on your PC. Far better than oldschool host file method. I'm using Quad9 on Adguard Home with Hagezi Multi PRO++ filter.
 

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
You can't.
If you don't want to switch your preferred DNS, then setup Adguard Home on your PC. Far better than oldschool host file method. I'm using Quad9 on Adguard Home with Hagezi Multi PRO++ filter.
I need a Raspberry Pi for that, right?

I have a ASUS router if it helps in any way.
 
  • Like
Reactions: SeriousHoax

SeriousHoax

Level 49
Verified
Top Poster
Well-known
Mar 16, 2019
3,862
I need a Raspberry Pi for that, right?

I have a ASUS router if it helps in any way.
No, you don't need that. You can install on your Windows system only.
You can follow this guide:
To simplify, download the latest version, extract it where you want to keep it, run powershell as admin in that folder, type and enter, ./AdGuardHome.exe -s install, open your browser, goto 127.0.0.1:3000, follow the setup wizard, make sure listen interface is 127.0.0.1, DNS server has to be set to all interface or something like that I think, create username and password, in DNS settings of Adguard Home panel set your preferred DNS eg: https://dns.quad9.net/dns-query, set your system DNS as 127.0.0.1 for IP4 and ::1 for IP6.
That's it.
If something doesn't work, check the official guide again. There are many more settings in Adguard Home like in DNS blocklist section of Filters set your preferred filter list. I have also increased my DNS minimum TTL to a higher value for less DNS query and faster browsing, etc.
It may look complicated at first, but it's very easy once you try it.
 

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
No, you don't need that. You can install on your Windows system only.
You can follow this guide:
To simplify, download the latest version, extract it where you want to keep it, run powershell as admin in that folder, type and enter, ./AdGuardHome.exe -s install, open your browser, goto 127.0.0.1:3000, follow the setup wizard, make sure listen interface is 127.0.0.1, DNS server has to be set to all interface or something like that I think, create username and password, in DNS settings of Adguard Home panel set your preferred DNS eg: https://dns.quad9.net/dns-query, set your system DNS as 127.0.0.1 for IP4 and ::1 for IP6.
That's it.
If something doesn't work, check the official guide again. There are many more settings in Adguard Home like in DNS blocklist section of Filters set your preferred filter list. I have also increased my DNS minimum TTL to a higher value for less DNS query and faster browsing, etc.
It may look complicated at first, but it's very easy once you try it.
Thanks for the guide. I will try to look into it. Does AdGuard Home the same as NextDNS?
What are you trying to block from the Steam browser? YouTube ads?
Just ads in general. I'm browsing while gaming rather than of tapping in and out to use Edge :)
 
F

ForgottenSeer 97327

I'm considering NextDNS. Does it support Quad9 - can I somehow use it with Quad9?
As @SeriousHoax said, you can't but you could for instance use Quad9 on your router or network adaptor by setting Alternative DNS for IPv4 and IPv6 and use Next DNS or AdGuard DNS by adding custom DNS-over-HTTPS in browser. Or you could use two different browsers with different DNS-over-HTTPS. You could for instance use one browser doe risky browsing (e,g, Edge because it has more security and privacy features) with a lot of privacy filters enabled at Adguard or NextDNS and use another browser (e.g. Chrome) for daily use with only OISD blocklist and an adblocker extension. When you encounter a problem you only have to disable adblocking for that website in your daily use browser.

As far as I know, browser setting has priority over network adaptor and network adaptor overrules the DNS setting in your router.
 

Orchid

Level 1
Jan 27, 2023
44
Is it possible to set-up a host file to auto-update?

Yes, @toto_10, you can. However, you may have to download a separate application/script to auto-update the host file. From my research (if you are going to use StevenBlack Host File), there are two options: 1 ) Download the updateHostsWindows.bat from the StevenBlack Host GitHub page link above and create a task manager to update the host's file to your liking or 2) Downloads Third-Party Hosts File Managers: Unified Hosts AutoUpdate (for Windows) or ViHoMa. I can't say how effective these Third-Party Hosts Managers are, as I updated the host file manually. However, looking at these two auto-updaters, Unified Hosts AutoUpdate seems to be the most active in their development and works in partnership with StevenBlack Host File.

References
Unified Hosts AutoUpdate
ViHoMa
 

toto_10

Level 5
Thread author
Verified
Well-known
Feb 12, 2017
249
Yes, @toto_10, you can. However, you may have to download a separate application/script to auto-update the host file. From my research (if you are going to use StevenBlack Host File), there are two options: 1 ) Download the updateHostsWindows.bat from the StevenBlack Host GitHub page link above and create a task manager to update the host's file to your liking or 2) Downloads Third-Party Hosts File Managers: Unified Hosts AutoUpdate (for Windows) or ViHoMa. I can't say how effective these Third-Party Hosts Managers are, as I updated the host file manually. However, looking at these two auto-updaters, Unified Hosts AutoUpdate seems to be the most active in their development and works in partnership with StevenBlack Host File.

References
Unified Hosts AutoUpdate
ViHoMa
@Orchid Thank you very much. I will try it out :)
 

About us

  • MalwareTips is a community-driven platform providing the latest information and resources on malware and cyber threats. Our team of experienced professionals and passionate volunteers work to keep the internet safe and secure. We provide accurate, up-to-date information and strive to build a strong and supportive community dedicated to cybersecurity.

User Menu

Follow us

Follow us on Facebook or Twitter to know first about the latest cybersecurity incidents and malware threats.

Top