NextDNS

They added YouTube ad blocking support

Go to Privacy → Add a blocklist on my.NextDNS.io and add NextDNS YouTube Ad Blocking. Give it a few minutes to kick in.

We wanted to get this out for testing now. Server redundancy and support for YouTube Restricted Mode are coming this week. For now, it has no effect if Restricted Mode is enabled.



Source : Reddit
 
I always thought DNS adblocking couldn’t block YouTube ads

But I guess it just needed priority

Now that the devs are actually interested again….
 
For any non NextDNS user, here is the ruleset for Youtube adblocking by redirecting/hijacking DNS entries to Albanian servers(which is what NextDNS is doing).
Code:
*.youtube.com A 91.239.7.227
*.googlevideo.com A 91.239.7.227
Also return NOERROR-NODATA i.e. empty responses to AAAA, HTTPS records for both domains.

91.239.7.227 serves Google's certificates so definitely a legit Google node in Albania.
Code:
# curl -v --resolve www.youtube.com:443:91.239.7.227 https://www.youtube.com > /dev/null
* Added www.youtube.com:443:91.239.7.227 to DNS cache
* Hostname www.youtube.com was found in DNS cache
  % Total    % Received % Xferd  Average Speed  Time    Time    Time   Current
                                 Dload  Upload  Total   Spent   Left   Speed
  0      0   0      0   0      0      0      0                              0*   Trying 91.239.7.227:443...
* ALPN: curl offers h2,http/1.1
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [1574 bytes data]
* SSL Trust Anchors:
*   CAfile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [1210 bytes data]
* TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):
{ [1 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [15 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [3542 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [78 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519MLKEM768 / id-ecPublicKey
* ALPN: server accepted h2
* Server certificate:
*   subject: CN=*.google.com
*   start date: Oct  7 19:07:42 2026 GMT
*   expire date: Dec 30 19:07:41 2026 GMT
*   issuer: C=US; O=Google Trust Services; CN=WE2
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA256
*   Certificate level 1: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
*   subjectAltName: "www.youtube.com" matches cert's "*.youtube.com"
* SSL certificate verified via OpenSSL.
* Established connection to www.youtube.com (91.239.7.227 port 443) from 192.168.29.37 port 43080
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://www.youtube.com/
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: www.youtube.com]
* [HTTP/2] [1] [:path: /]
* [HTTP/2] [1] [user-agent: curl/8.18.0]
* [HTTP/2] [1] [accept: */*]
} [5 bytes data]
> GET / HTTP/2
> Host: www.youtube.com
> User-Agent: curl/8.18.0
> Accept: */*
>
* Request completely sent off
} [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [283 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [283 bytes data]
< HTTP/2 200
< content-type: text/html; charset=utf-8
< x-content-type-options: nosniff

* Connection #0 to host www.youtube.com:443 left intact
 
Back