I have seen several topics here about how to block Youtube Ads. People are suggesting few regex to do so. However, my question is, why is it too easy to block Youtube ads using browser-based ad-blocker extension (e.g., AdBlock)? Are not they also filtering using urls? Why do not we have similar filter for dns-based ad-blocker?
As any DNS filter, Pi-hole never sees URLs - it only ever sees the domain that a client is requesting.
This has been asked and answered quiet a few times before, see e.g. PiHole setup on Docker on Windows is not Blocking Ads - #2 by Bucking_Horn.
They filter on the complete URL. Pi-hole filters on the domain only.
This is a URL:
This is the domain from that URL:
Because the two methods of blocking are fundamentally different. Pi-hole uses domains only in a hosts format.
Thank you for your reply.
Is not the google ad server being communicated during the ad bid process has a special domain different from youtube.com domain? why do not we block that domain entirely?
Does it make proxy-based ad-blocking somehow better than DNS ones? (because it has access to the hole URL)
I cannot know why you haven't already blocked that domain if that would be your goal.
Feel free to do so, but note that blocking domains may well result in overblocking if the same domain would be used to serve content as well as ads.
Also note that there have been numerous attempts to block YouTube through DNS-based filtering by a different means - ultimately, all of them seem to have been countered by YT/Google in the end. You may use this forum's search options to find out about that history, e.g. How do I block ads on YouTube?
The complete URL would only be accessible for HTTP requests.
Nowadays, the vast majority of websites is using HTTPS.
To examine those, you would need to forge certificates and stage a MITM attack on your own network's traffic. But this would fail if the receiving website is prepared to thwart such attempts, e.g. by using certificate pinning.
In addition, you'd need considerably beefier hardware to run such a proxy than would be required for running a Pi-hole filtering your entire networks DNS traffic only.
This is well-explained.
I do agree with you on the heaviness of a proxy service (unless it is hosted locally, e.g., on a virtualised container, just for a single host) and the limitation to access https URLs (if it is a network-based proxy).
I do not know indeed the specific domain name for google ad server. I was just wondering that it should be something different from Youtube.com. I think the domain name of the ad content provider is randomised, e.g., lkfjgvhgjgjve.googlevideo.com, is not it? If this is true, could you provide an example of none-ad content being provided by a similar domain name?
Finally, could you please provide an example of youtube ad url through which it was easy for AdBlocker to recognise it as an ad while not for a dns-based one?.
Hi again everyone,
Could you please provide an example on a youtube ad url where a browser-extension can easily recognise and block whereas it is not easy to recognise on the dns level and distiguish it from a none-ad content?
YouTube is working around blockers based on URLs. Now they use techniques such as inserting the ad content into the video stream data dynamically, and keying the player to the stream on a per-play basis. Some blockers have some success with these newer methods by proxying the video and taking out the ad parts and presenting that to the user, but that's a bit of a privacy risk and it's very much a cat and mouse game between YouTube and the ad-blockers. Now and again a new ad-free YouTube tool appears and works great for a while, then stops working as YouTube works around it.
Thanks Chrislph for your reply.
But AdBlock, is still effective with Youtube. I have just tested it and it is blocking all ads. AdBlock is not proxy based. It is URL-filter based, so how it is being able to block ads based on URL?
Let me emphasise again that Pi-hole sees domains only.
If you wonder about URLs, that would be a question for a maintainer of a tool that leverages client-side URL inspection to block ads
That is asking a question about internal processing of Adblock.
I guess an AdBlock developer would be in a better position to answer that question.
Thank you for your reply.
Yes I know that Pi-Hole is DNS-based not URL. My question was about an example of a YouTube Ad-URL that has a domain name which Pi-Hole can not block because the same domain name is used to deliver another none-ad service.
You are right, if I ask an Ad-Block extension developer, he/she might be able to assist me in this regard. I have already indeed subsrcibed to EasyList and waiting for them to activate my membership so that I can ask the question overthere as well if I can not get an example.
Thanks Dan, I need the full URL please. For instance, it will be something like:
This can be a URL used during ad communication (due to /ads in the URL). It also uses youtube.com domain name, therefore, it can not be blocked by DNS without blocking YouTube services. Nevertheless, I could not find such URL while intercepting YouTube communication. This is why I am asking for an example
That's not something we have any insight into. We don't see anything other than a domain.