Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
youtube ads hosts file
This project has been moved to a GitHub repository to allow Pull Requests.
See: https://github.com/Ewpratten/youtube_ad_blocklist
@WillieStevenson

This comment has been minimized.

Copy link

@WillieStevenson WillieStevenson commented Dec 11, 2018

Hi, I'm a big fan of DNSBL's, including this list, but I would make just one change to this one.
A number of legitimate sites use google's captcha API, which is loaded over their gstatic.com domain. In other words, some sites break if captchas aren't present. As much as I am not a fan of wanting to remove gstatic from list this due to other resources that could be fetched from this domain, can this be considered a legitimate use case for removal?

@DavidsProTv

This comment has been minimized.

Copy link

@DavidsProTv DavidsProTv commented Dec 30, 2018

Hello,
I would remove the gstatic.com, www.gstatic.com and the apis.google.com domains because some websites use a API from Google and could not be load this API with this setting in the hosts file.


For everyone who want block the youtube ads:
Some YouTuber only get there money from ads and if you block this ads, maybe they don't get enough money. Maybe they have to quit there YouTube life and you can't watch them anymore. Think about, YouTube is free and everyone can use it without money. The only think you have to do for this free service is watch ads. If you remove this option for YouTube they have to change there system to a paid system. Maybe they never would do it but its a option. Think about it :)

@refriedfood

This comment has been minimized.

Copy link

@refriedfood refriedfood commented Apr 19, 2019

Maybe they have to quit there YouTube life

Then shame on them for being an advertisement whore.

@deama

This comment has been minimized.

Copy link

@deama deama commented Aug 29, 2019

It's youtube's own damn fault, they're squeezing way too tightly, I'm getting 2 ads in a row now, sometimes 2 ads in a row before video starts AND then right in the middle!

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Aug 29, 2019

I was wondering why i had never noticed an issue with the domains you guys listed.. Turns out they where in my pi-hole whitelist.. Ill see what I can do. Removing them is probably a good idea.

@lain0

This comment has been minimized.

Copy link

@lain0 lain0 commented Sep 1, 2019

duplicates:
googleads.g.doubleclick.net is on lines on lines 7, 23, 36
s.youtube.com is on 12 and 28
ad.doubleclick.net on 24 and 33
pagead2.googlesyndication.com in on 9, 29

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Sep 1, 2019

Duplicates have been removed

@bomthoa

This comment has been minimized.

Copy link

@bomthoa bomthoa commented Sep 10, 2019

Keybase proof

I hereby claim:

  • I am bomthoa on github.
  • I am bomthoa (https://keybase.io/bomthoa) on keybase.
  • I have a public key ASA8wATOPIzoV_n65o0R1o5i8w_j_swM4VSMYIL9jmGSawo

To claim this, I am signing this object:

{
  "body": {
    "key": {
      "eldest_kid": "01203cc004ce3c8ce857f9fae68d11d68e62f30fe3fecc0ce1548c6082fd8e61926b0a",
      "host": "keybase.io",
      "kid": "01203cc004ce3c8ce857f9fae68d11d68e62f30fe3fecc0ce1548c6082fd8e61926b0a",
      "uid": "9e7f9333516166ca123f99676ef80b19",
      "username": "bomthoa"
    },
    "merkle_root": {
      "ctime": 1568118257,
      "hash": "1c7728510d51b8cd313492ab201b5f74c7ce92f945b299ac996ffba122f93b73db6dae0ac1b1ad088d3ca624c1a971bb1dc08492b6ee6d11c39fcfcdf5d6176b",
      "hash_meta": "0a1b009b0a41cb023192ede306cc80b5496477a56d78fe7cf8529d548768acca",
      "seqno": 6399040
    },
    "service": {
      "entropy": "5G9ufiMB8/WYYMpobOwUr9b9",
      "name": "github",
      "username": "bomthoa"
    },
    "type": "web_service_binding",
    "version": 2
  },
  "client": {
    "name": "keybase.io go client",
    "version": "4.4.0"
  },
  "ctime": 1568118265,
  "expire_in": 504576000,
  "prev": "fc9bf1ac673357409732deb3761090c50590a79ddfc81d9cee6ee5f22a539d26",
  "seqno": 7,
  "tag": "signature"
}

with the key ASA8wATOPIzoV_n65o0R1o5i8w_j_swM4VSMYIL9jmGSawo, yielding the signature:

hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgPMAEzjyM6Ff5+uaNEdaOYvMP4/7MDOFUjGCC/Y5hkmsKp3BheWxvYWTESpcCB8Qg/JvxrGczV0CXMt6zdhCQxQWQp53fyB2c7m7l8ipTnSbEIOcOMCPrVmZtfnxsILcSW5y9u9346an5pBgo/z1I8K1qAgHCo3NpZ8RANxGtkOm7lYXlwPmyAJ2GqXdPWOs2lEMkZ1SS7GIYYQTMAtRXMjhpL57mTp10HEkN5opYONJpGyJrf7Hwmk9cBahzaWdfdHlwZSCkaGFzaIKkdHlwZQildmFsdWXEIKNqtLV+1XqxpJVU5aS70yI7OwQgMp29rAaXx8ATvvydo3RhZ80CAqd2ZXJzaW9uAQ==

And finally, I am proving ownership of the github account by posting this as a gist.

My publicly-auditable identity:

https://keybase.io/bomthoa

From the command line:

Consider the keybase command line program.

# look me up
keybase id bomthoa
@bomthoa

This comment has been minimized.

Copy link

@bomthoa bomthoa commented Sep 10, 2019

H

@apismennyj

This comment has been minimized.

Copy link

@apismennyj apismennyj commented Sep 17, 2019

So what, bomthoa? Take a cookie and relax ;)

@empirefx

This comment has been minimized.

Copy link

@empirefx empirefx commented Dec 10, 2019

Thanks for the list, Adblock plus stopped working on yt, dont know why

@Totally3D

This comment has been minimized.

Copy link

@Totally3D Totally3D commented Feb 13, 2020

Please ADD these to your host file to block ADS on youtube all thanks

r8.sn-4g5ednzz.googlevideo.com
r8---sn-4g5ednzz.googlevideo.com
r6.sn-4g5ednll.googlevideo.com
r6.sn-4g5edney.googlevideo.com
r6.sn-4g5ednek.googlevideo.com
r6.sn-4g5ednee.googlevideo.com
r6.sn-4g5edn7e.googlevideo.com
r6.sn-4g5e6nez.googlevideo.com
r6---sn-4g5ednll.googlevideo.com
r6---sn-4g5edney.googlevideo.com
r6---sn-4g5ednek.googlevideo.com
r6---sn-4g5ednee.googlevideo.com
r6---sn-4g5edn7e.googlevideo.com
r6---sn-4g5e6nez.googlevideo.com
r5.sn-h0jeenek.googlevideo.com
r5.sn-4g5ednzz.googlevideo.com
r5.sn-4g5ednsz.googlevideo.com
r5.sn-4g5ednsy.googlevideo.com
r5.sn-4g5ednsr.googlevideo.com
r5.sn-4g5ednsl.googlevideo.com
r5.sn-4g5ednsd.googlevideo.com
r5.sn-4g5edns6.googlevideo.com
r5.sn-4g5ednly.googlevideo.com
r5.sn-4g5edn7s.googlevideo.com
r5.sn-4g5e6nzl.googlevideo.com
r5.sn-4g5e6nze.googlevideo.com
r5.sn-4g5e6nz7.googlevideo.com
r5.sn-4g5e6nsz.googlevideo.com
r5.sn-4g5e6nsy.googlevideo.com
r5.sn-4g5e6nss.googlevideo.com
r5.sn-4g5e6nsk.googlevideo.com
r5.sn-4g5e6ns7.googlevideo.com
r5.sn-4g5e6ns6.googlevideo.com
r5.sn-4g5e6nls.googlevideo.com
r5.sn-4g5e6ney.googlevideo.com
r5.sn-4g5e6n7r.googlevideo.com
r5.sn-4g5e6n7k.googlevideo.com
r5---sn-h0jeenek.googlevideo.com
r5---sn-4g5ednzz.googlevideo.com
r5---sn-4g5ednsz.googlevideo.com
r5---sn-4g5ednsy.googlevideo.com
r5---sn-4g5ednsr.googlevideo.com
r5---sn-4g5ednsl.googlevideo.com
r5---sn-4g5ednsd.googlevideo.com
r5---sn-4g5edns6.googlevideo.com
r5---sn-4g5ednly.googlevideo.com
r5---sn-4g5edn7s.googlevideo.com
r5---sn-4g5e6nzl.googlevideo.com
r5---sn-4g5e6nze.googlevideo.com
r5---sn-4g5e6nz7.googlevideo.com
r5---sn-4g5e6nsz.googlevideo.com
r5---sn-4g5e6nsy.googlevideo.com
r5---sn-4g5e6nss.googlevideo.com
r5---sn-4g5e6nsk.googlevideo.com
r5---sn-4g5e6ns7.googlevideo.com
r5---sn-4g5e6ns6.googlevideo.com
r5---sn-4g5e6nls.googlevideo.com
r5---sn-4g5e6ney.googlevideo.com
r5---sn-4g5e6n7r.googlevideo.com
r5---sn-4g5e6n7k.googlevideo.com
r4.sn-4g5ednz7.googlevideo.com
r4.sn-4g5ednsy.googlevideo.com
r4.sn-4g5ednsk.googlevideo.com
r4.sn-4g5ednsd.googlevideo.com
r4---sn-4g5ednz7.googlevideo.com
r4---sn-4g5ednsy.googlevideo.com
r4---sn-4g5ednsk.googlevideo.com
r4---sn-4g5ednsd.googlevideo.com
r3.sn-4g5ednz7.googlevideo.com
r3.sn-4g5ednss.googlevideo.com
r3.sn-4g5ednsd.googlevideo.com
r3.sn-4g5ednls.googlevideo.com
r3.sn-4g5ednll.googlevideo.com
r3.sn-4g5ednee.googlevideo.com
r3.sn-4g5edned.googlevideo.com
r3.sn-4g5edne7.googlevideo.com
r3.sn-4g5edne6.googlevideo.com
r3.sn-4g5e6nzz.googlevideo.com
r3.sn-4g5e6nzs.googlevideo.com
r3.sn-4g5e6nsz.googlevideo.com
r3.sn-4g5e6nsy.googlevideo.com
r3.sn-4g5e6nsk.googlevideo.com
r3.sn-4g5e6nle.googlevideo.com
r3.sn-4g5e6nld.googlevideo.com
r3---sn-4g5ednz7.googlevideo.com
r3---sn-4g5ednss.googlevideo.com
r3---sn-4g5ednsd.googlevideo.com
r3---sn-4g5ednls.googlevideo.com
r3---sn-4g5ednll.googlevideo.com
r3---sn-4g5ednee.googlevideo.com
r3---sn-4g5edned.googlevideo.com
r3---sn-4g5edne7.googlevideo.com
r3---sn-4g5edne6.googlevideo.com
r3---sn-4g5e6nzz.googlevideo.com
r3---sn-4g5e6nzs.googlevideo.com
r3---sn-4g5e6nsz.googlevideo.com
r3---sn-4g5e6nsy.googlevideo.com
r3---sn-4g5e6nsk.googlevideo.com
r3---sn-4g5e6nle.googlevideo.com
r3---sn-4g5e6nld.googlevideo.com
r2.sn-hp57kn6e.googlevideo.com
r2.sn-h0jeln7e.googlevideo.com
r2.sn-h0jeener.googlevideo.com
r2.sn-h0jeen76.googlevideo.com
r2.sn-4g5ednzz.googlevideo.com
r2.sn-4g5ednly.googlevideo.com
r2.sn-4g5ednls.googlevideo.com
r2.sn-4g5ednle.googlevideo.com
r2.sn-4g5ednee.googlevideo.com
r2.sn-4g5edned.googlevideo.com
r2.sn-4g5edn7y.googlevideo.com
r2.sn-4g5e6nsz.googlevideo.com
r2.sn-4g5e6nsy.googlevideo.com
r2.sn-4g5e6nsk.googlevideo.com
r2.sn-4g5e6ns6.googlevideo.com
r2.sn-4g5e6nl7.googlevideo.com
r2.sn-4g5e6ney.googlevideo.com
r2---sn-hp57kn6e.googlevideo.com
r2---sn-h0jeln7e.googlevideo.com
r2---sn-h0jeener.googlevideo.com
r2---sn-h0jeen76.googlevideo.com
r2---sn-4g5ednzz.googlevideo.com
r2---sn-4g5ednse.googlevideo.com
r2---sn-4g5ednly.googlevideo.com
r2---sn-4g5ednls.googlevideo.com
r2---sn-4g5ednle.googlevideo.com
r2---sn-4g5ednee.googlevideo.com
r2---sn-4g5edned.googlevideo.com
r2---sn-4g5edn7y.googlevideo.com
r2---sn-4g5e6nsz.googlevideo.com
r2---sn-4g5e6nsy.googlevideo.com
r2---sn-4g5e6nsk.googlevideo.com
r2---sn-4g5e6ns6.googlevideo.com
r2---sn-4g5e6nl7.googlevideo.com
r2---sn-4g5e6ney.googlevideo.com
r15.sn-4g5ednzz.googlevideo.com
r15---sn-4g5ednzz.googlevideo.com
r11.sn-4g5ednzz.googlevideo.com
r11---sn-4g5ednzz.googlevideo.com
r10.sn-4g5ednzz.googlevideo.com
r10---sn-4g5ednzz.googlevideo.com
r1.sn-h0jeln7e.googlevideo.com
r1.sn-h0jeened.googlevideo.com
r1.sn-h0jeen76.googlevideo.com
r1.sn-4g5ednsd.googlevideo.com
r1.sn-4g5ednly.googlevideo.com
r1.sn-4g5ednll.googlevideo.com
r1.sn-4g5edne6.googlevideo.com
r1.sn-4g5e6nzz.googlevideo.com
r1.sn-4g5e6nz7.googlevideo.com
r1.sn-4g5e6nsy.googlevideo.com
r1.sn-4g5e6nez.googlevideo.com
r1---sn-h0jeln7e.googlevideo.com
r1---sn-h0jeened.googlevideo.com
r1---sn-h0jeen76.googlevideo.com
r1---sn-4g5ednsd.googlevideo.com
r1---sn-4g5ednly.googlevideo.com
r1---sn-4g5ednll.googlevideo.com
r1---sn-4g5edne6.googlevideo.com
r1---sn-4g5e6nzz.googlevideo.com
r1---sn-4g5e6nz7.googlevideo.com
r1---sn-4g5e6nsy.googlevideo.com
r1---sn-4g5e6ns7.googlevideo.com
r1---sn-4g5e6nez.googlevideo.com
manifest.googlevideo.com
r8.sn-n02xgoxufvg3-2gbs.googlevideo.com
r8---sn-n02xgoxufvg3-2gbs.googlevideo.com
r6.sn-4g5edne7.googlevideo.com
r6---sn-4g5edne7.googlevideo.com
r5.sn-hp57yn7y.googlevideo.com
r5---sn-hp57yn7y.googlevideo.com
r4.sn-h0jeln7l.googlevideo.com
r4.sn-h0jeln7e.googlevideo.com
r4.sn-h0jeened.googlevideo.com
r4.sn-4g5ednzz.googlevideo.com
r4.sn-4g5edns7.googlevideo.com
r4.sn-4g5ednly.googlevideo.com
r4.sn-4g5ednld.googlevideo.com
r4.sn-4g5edney.googlevideo.com
r4.sn-4g5e6nzs.googlevideo.com
r4.sn-4g5e6ns6.googlevideo.com
r4.sn-4g5e6nez.googlevideo.com
r4---sn-h0jeln7l.googlevideo.com
r4---sn-h0jeln7e.googlevideo.com
r4---sn-h0jeened.googlevideo.com
r4---sn-4g5ednzz.googlevideo.com
r4---sn-4g5edns7.googlevideo.com
r4---sn-4g5ednly.googlevideo.com
r4---sn-4g5ednld.googlevideo.com
r4---sn-4g5edney.googlevideo.com
r4---sn-4g5e6nzs.googlevideo.com
r4---sn-4g5e6ns6.googlevideo.com
r4---sn-4g5e6nez.googlevideo.com
r3.sn-4g5ednzz.googlevideo.com
r3.sn-4g5ednsz.googlevideo.com
r3.sn-4g5edns6.googlevideo.com
r3.sn-4g5ednld.googlevideo.com
r3.sn-4g5e6nsr.googlevideo.com
r3.sn-4g5e6nl7.googlevideo.com
r3---sn-4g5ednzz.googlevideo.com
r3---sn-4g5ednsz.googlevideo.com
r3---sn-4g5edns6.googlevideo.com
r3---sn-4g5ednld.googlevideo.com
r3---sn-4g5e6nsr.googlevideo.com
r3---sn-4g5e6nl7.googlevideo.com
r2.sn-4g5ednse.googlevideo.com
r2.sn-4g5ednld.googlevideo.com
r2.sn-4g5e6nzl.googlevideo.com
r2.sn-4g5e6nez.googlevideo.com
r2---sn-4g5ednld.googlevideo.com
r2---sn-4g5e6nzl.googlevideo.com
r2---sn-4g5e6nez.googlevideo.com
r1.sn-4g5ednsr.googlevideo.com
r1.sn-4g5ednsl.googlevideo.com
r1.sn-4g5ednse.googlevideo.com
r1.sn-4g5edned.googlevideo.com
r1.sn-4g5e6ns7.googlevideo.com
r1.sn-4g5e6ns6.googlevideo.com
r1.sn-4g5e6nl6.googlevideo.com
r1.sn-4g5e6ne6.googlevideo.com
r1---sn-4g5ednsr.googlevideo.com
r1---sn-4g5ednsl.googlevideo.com
r1---sn-4g5ednse.googlevideo.com
r1---sn-4g5edned.googlevideo.com
r1---sn-4g5e6ns6.googlevideo.com
r1---sn-4g5e6nl6.googlevideo.com
r1---sn-4g5e6ne6.googlevideo.com

@yateendra

This comment has been minimized.

Copy link

@yateendra yateendra commented Apr 19, 2020

Thanks for the list, Adblock plus stopped working on yt, dont know why

ublock works

@GitHubb3R

This comment has been minimized.

Copy link

@GitHubb3R GitHubb3R commented Apr 19, 2020

I'd like to notify that you have the following duplicates at the end:
0.0.0.0 fwmrm.net 0.0.0.0 innovid.com 0.0.0.0 2mdn.net

Also I think the entry in line 44 does not really do anything.
( 0.0.0.0 0.0.0.0 )

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Apr 20, 2020

@Totally3D @GitHubb3R

I have made these updates

@BuzzardEagle

This comment has been minimized.

Copy link

@BuzzardEagle BuzzardEagle commented Apr 26, 2020

Hello I have copy pasted this addresses in the host file , BUT Youtube ads keep coming without even any problems , what should i do ??

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Apr 28, 2020

The youtube ads domains change all the time, and are different depending on the region. I try to keep this list up to date, but things will always slip by

@peter9811

This comment has been minimized.

Copy link

@peter9811 peter9811 commented Jun 10, 2020

Thanks
This work on Windows? I want try it

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Jun 11, 2020

Hey @peter9811

This list is specifically designed for PIHole and Linux servers, but should work fine locally on windows. I do not use Windows, so I will be unable to help you if you have an issue getting it running though.

@GitHubb3R

This comment has been minimized.

Copy link

@GitHubb3R GitHubb3R commented Jun 12, 2020

Thanks
This work on Windows? I want try it

Yes it does, but the hosts may or may not be up to date, because updating these is kind of an uphill battle, since there are people on the advertising end who are paid to screw with you, all the while you do this for free.

You can modify the hosts file in Windows like this:
https://support.microsoft.com/en-us/help/972034/how-to-reset-the-hosts-file-back-to-the-default
Now this points you to reset the file, but its the path of the file that matters. (I've linked this, since this is an official documentation.)

Make sure you copy and paste the these into the hosts file (whereas # is for comments, lines beginning with it are ignored). You will also need Administrator permissions to do these modifications. And an important thing to keep in mind is, that you cannot block certain Microsoft related hosts using this way, but I think there are none listed here (thankfully).

@fte

This comment has been minimized.

Copy link

@fte fte commented Jul 2, 2020

commented s.ytimg.com to make music.youtube worky

@Lyceris-chan

This comment has been minimized.

Copy link

@Lyceris-chan Lyceris-chan commented Jul 12, 2020

commented s.ytimg.com to make music.youtube worky

I love you

@ivan-boginski

This comment has been minimized.

Copy link

@ivan-boginski ivan-boginski commented Oct 6, 2020

Some ads still appear, how to block all of them?

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Oct 6, 2020

pay for premium?

Nobody has the time to track down every single domain name they use. Its not realistic.

@Lyceris-chan

This comment has been minimized.

Copy link

@Lyceris-chan Lyceris-chan commented Oct 14, 2020

Some ads still appear, how to block all of them?

install youtube music as a web app and use vanced on mobile this way you can just use an adblock extension without issues

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Oct 14, 2020

Some ads still appear, how to block all of them?

If you are on android, you can also check out: https://github.com/TeamNewPipe/NewPipe

@gitdine

This comment has been minimized.

Copy link

@gitdine gitdine commented Dec 6, 2020

Blocking youtube-nocookie.com and www.youtube-nocookie.com breaks many embedded YouTube videos.

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Dec 8, 2020

@gitdine Unblocked.

@Igor-GS

This comment has been minimized.

Copy link

@Igor-GS Igor-GS commented Dec 23, 2020

It works! :D Thank you very much!

@Igor-GS

This comment has been minimized.

Copy link

@Igor-GS Igor-GS commented Dec 28, 2020

I started use the hosts file and there is not appear Google Maps layer in applications that use it ¯_(ツ)_/¯

@gatinhonico

This comment has been minimized.

Copy link

@gatinhonico gatinhonico commented Jan 10, 2021

Please ADD these to your host file to block ADS on youtube all thanks

r2---sn-5hne6n7z.googlevideo.com
r2---sn-25ge7nsd.googlevideo.com
r4---sn-25ge7nsk.googlevideo.com
r6---sn-25ge7nsl.googlevideo.com
r1---sn-25glen7y.googlevideo.com
r1---sn-25glenez.googlevideo.com
r10---sn-4gxx-25gel.googlevideo.com
r11---sn-4gxx-25ge7.googlevideo.com
r4---sn-4gxx-25gee.googlevideo.com
r16---sn-4gxx-25ge7.googlevideo.com
r3---sn-4gxx-25gel.googlevideo.com
r1---sn-4gxx-25gel.googlevideo.com
r9---sn-4gxx-25gel.googlevideo.com
r9---sn-4gxx-25gy.googlevideo.com
r6---sn-4g5e6nes.googlevideo.com

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Jan 10, 2021

@Ewpratten

This comment has been minimized.

Copy link
Owner Author

@Ewpratten Ewpratten commented Jan 20, 2021

This project has been moved to a GitHub repository to allow Pull Requests. See: https://github.com/Ewpratten/youtube_ad_blocklist

@bicnar

This comment has been minimized.

Copy link

@bicnar bicnar commented Feb 5, 2021

@Totally3D very thanks y add the rules to my DNS STATIC mikrotik with dst loopback IP all its fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment