Need YouTube CIDR/Netmask

hello all

i need to all of YouTube IPv4 Ranges for Mark Routing on MikroTik
Find out where ?

Best Regards

Type in Windows command line: nslookup youtube.com

nslookup would just give you the address(es) of the servers providing the basic website. I only get a single address returned, and it’s highly unlikely that’s the only address. On top of that, there are various other domains such as ytimg.com used to load parts of the website, most of which will be globally distributed.

Then of course the actual video is served from numerous locations, mostly using automated, distributed sources with random looking hostnames like r5---sn-aigzrn7e.googlevideo.com.

Finding the address ranges of all this in order to match all youtube traffic is a tall order, unless Google publish it themselves.

You can find a few lists on the net, although I doubt any of them are complete, especially as it likely changes constantly.

These ones? :slight_smile:

https://www.lifewire.com/what-is-the-ip-address-of-google-818153

They are likely to continuously change/grow/shrink etc, your best bet is to try use content filter on DNS names used by youtube so no matter the IP the packets get marked.. Takes more CPU though.

Or he can use tls-host property in firewall filter in forward chain:

tls-host (string; Default: ) Allows to match https traffic based on TLS SNI hostname. Accepts GLOB syntax for wildcard matching. Note that matcher will not be able to match hostname if TLS handshake frame is fragmented into multiple TCP segments (packets).

https://wiki.mikrotik.com/wiki/Manual%3AIP/Firewall/Filter#Properties

thank a lot

www.youtube.com in my country is filtered by the government
I can not use the dns trick !!!

Please provide a good solution

Please provide a good solution

You can try these:

https://bgp.he.net/AS15169#_prefixes

It’s whole Google, but I don’t know about a way how to get only Youtube (two listed ranges have Youtube in description, but you can’t go by that, e.g from here, youtube.com is not in either of them).

Why goverment filtered while you can access youtube.com ?

Google edge cache using ISP’s address in some country.