I’ve had TWC for over a year and have been frustrated at the shockingly crap Youtube performance. I never had issues with other web browsing, downloads, or Netflix, so I simply shrugged it off and continued with life. A few days ago I came across this video and some discussions on Reddit which prompted me to explore further.
A few terminal commands later to reject certain IP addresses and I was back to blazingly fast Youtube streaming (and Twitch.tv). Doing this will cause the stream to take 1-2 seconds to start because of the IP rejection handling, but then you are greeted with a silky smooth, ultra fast experience.
Open up your terminal and run these commands (you will be prompted for the admin password):
sudo ipfw add reject src-ip 173.194.55.0/24 in
sudo ipfw add reject src-ip 206.111.0.0/16 in
You can check the rules were added by using this command:
sudo ipfw list
Need to delete these rules? No problem, just run the ‘sudo ipfw list’ command again. Next to each rule is a reference number, so take the number of the rule you want to delete and replace the ‘X’ in this command with that number:
sudo ipfw delete X
Why do these commands create a better streaming experience? TWC is throttling downloads from servers (CDN) that host cached videos. By rejecting these IP address ranges you will force the video to be served to you directly. This harnesses the full download speed of your internet connection. Other people can dive into the complexity much better than I ever could, but that’s the overall theme.
If you’re not using a Mac, here’s some tips to make this work:
- Linux – instead of ipfw use iptables command
- Windows – check out this guide
- Multiple computers – configure the IP blocks via your router.
Did this trick work for you? Let me know in the comments below.
EDIT (Feb 25, 2013): After some great discussion on HN, I wanted to address that before posting I did test a number of ISPs, and also I read various on message boards, that complained about speed, appeared to be overwhelmingly TWC. That’s not ideal proof, but this was just intended to be a share of a personal quick fix. I’ve modified the title to reflect that is not specific to TWC. Enjoy the hack!
Worked like a charm!
id prefer to do this through the router. I have a Lynksis WRT54G2. Would this work if i just copy and pasted 173.194.55.0/24 and 206.111.0.0/16 into “Website blocking by URL address” ??? It’s located in Access Restrictions.
Where do I find the terminal? isit the command promt?
Search Terminal in Finder?
You’re on a Windows. This is only for Mac.
If you are on a Mac though, Terminal is in Applications > Utilities > Terminal.app
THANK YOU SO MUCH! It worked perfectly here
This really worked for me. I watch a lot on Twitch.tv and couldn’t 1080+ because it would lag and it would buffer for so long. After doing this watching streams at 1080+ is smooth like ice cream dripping from a cone on a hot summer day. Thank you so much!
The redirector I had was xo-lax1, which expands to o-o.preferred.xo-lax1.v8.lscache3.c.bigcache.googleapis.com. Doing a ping on this, I got 206.111.11.5. I just added this to the list: sudo ipfw add reject src-ip 206.111.11.51/24 in and immediately Youtube works better. Thanks.
How can I determine if this is my problem with my at&t dsl, which sucks anyway, but I was able to stream Youtube vids until a few months ago. Now Youtube is unusable for me. How can I find out if they( at&t) are throttling?
Believe it or not, this also work here in Sweden. I’ve had these problems for a long while. I have 100/100mbit fiber on Telia (ISP), and 9 out of 10 Youtube movies was almost impossible to watch because of buffering and stuttering. The above ip blocks fixed the problem :D
Thank you very much!
Ohio TWC user, the second one (206.) did not work and prevented youtube from loading anything. Just using the first one (173.) worked and made youtube much snappier. Great fix thanks!
I’ve been fighting with this issue for a few weeks and none of the patches seemed to work for me. Ultimately I found I was able to get around the issue by watching all of my YT videos in IE rather than in Chrome of Firefox. I don’t know if this will work for anyone else but switching browsers completely cleaned up the problem for me.
Add 208.117.251.0/24 to the list.
No luck and I doubt there will be a fix anytime soon. In the problem areas/states where TWC users are having issues (which seems to be dominantly in the midwest), There is literally no competition for TWC in terms of ISP’s. Strange huh? Just like there is literally no competition for twitch.tv in terms of video game streaming websites. These companies cut costs and lower the quality of service where they can get away with it because there is no alternative. Now, what if Google opened up their own video game streaming website? or launched Google Fiber all across the US? I can guarantee none of us would have any lag problems on twitch or with TWC. Welcome to America.
Does anyone know if this is supposed to work in the UK? It’s a Uni network.
for those using ipfw on a mac, you have to open a command shell via “terminal” app and run these commands with the appropriate sudo permissions. I added this but got zero hits on the rule *counters* using verizon so i can only assume these subnets do not apply here – was worth a go at it.
For those interested, if you issue –> sudo ipfw -a list you’ll see something like this:
mbp:~ op$ sudo ipfw -a list
00100 0 0 reject ip from 173.194.55.0/24 to any in
00200 0 0 reject ip from 206.111.0.0/24 to any in
65535 27599 19819261 allow ip from any to any
Lines 00100 + 00200 are the newly added rules…
I keep getting an Invalid Argument when I go to delete these… it seems to have made things way worse. How can I fix this? Is there something I’m missing?
It’s not the IP you want to delete, it’s the list number. Use the list command, and it’ll show you (likely) two entries. The entry # at the beginning is what you want to tell it to delete.
Well I’ll be damned. As of about late April, this trick no longer works. Vimeo seems very slow to load, and Youtube gives me the “white noise” screen when these blocks are in place.
If you remove “206.111.0.0/16″, it seems to work again.
Mitch – I was shocked when I heard about this and would explain all the issues I’ve had with streaming video. I have “business class” TWC, 15 Mbps down. I tried this fix on my MacBook Pro with OS X 10.8.3, but when I try playing YouTube videos in Chrome, the YouTube pages load, but the video don’t even load at all. Eventually in the video window, it says “An error occurred, please try again later.” Any suggestions on how to troubleshoot or do you know the reason?
Same issue here. I’m on TWC in NYC. Sometimes it work, sometimes it doesn’t. I tried on cross plafrom Chome, Firefox, Safari and the result is the same. It’s a real shame and I’m sure a class-actions will emerge soon because it’s a TWC Scam policy
Thanks, this worked on Telstra’s ADSL2+ in Australia. Went from not being able to watch long videos to them playing perfectly. Great work.
This doesn’t seem to be working for me, I did all the instructions as they said for Macs. Recently my ISP got bought out by Time Warner, and now my internet sucks. Before I could instantly load 1080p youtube videos, now even on 240 they won’t even load half the time.
Thank you so much for sharing this.
For anyone in Brazil trying this, what seems to have worked for me is: sudo ipfw add reject src-ip 189.123.228.0/24 in.
worked like a charm for me. As of May 1st, 2013, my youtube has been very fast and ive even been able to watch videos in 1080p with no buffering. THANKS FOR THIS
works for me, thanks!!
ERMAHGERD THERNK YER!
Worked like a charm! Thanks so very much!!
I LOVE YOU. REALLY.
Hold a newbie’s hand… what do you mean by “open your terminal?” Not sure what that means. FYI, I’m on a Mac.
press CMD + Space, then type “Terminal”
This doesnt seem to work for me. The video plays right away, but the freezes @ 0:02 and loads nothing. i have the 50/25 fios deal, and these videos are in 240p, not loading. Vimeo however will load the 1280p instantly.
Verizon’s TOS says that they don’t throttle or limit any internet usage, a vast departure from the TOS of Time Warner. I wouldn’t worry about throttling.
They do throttle. MTR shows up to 90% packets from youtube being dropped on verizon routers.
worked great in the UAE – many thanks!!
Is there an iOS guide for this hack?
You’d have to configure the IP block via router.
All I can say is after hours of discussions with FiOS tech support, 3 routers, and months of brain blowing frustration, THANK YOU LORDY JESUS! The IP blocking through my router fixed this problem on all of my devices. YOU F-ING ROCK MAN!
How did you do this to your router, instead of your terminal? Thanks, John
Every router comes with a configuration intranet page, you can get to it by introducing http://home (sometimes work) or http://192.168.1.264 (this is normally the gateway to your local router network)… inside that page there should be an option to block incoming and outgoing connections where you can give specific IPs
I wonder if phone companies do this on cell phones. This worked great for me on youtube. Hopefully it works with Crunchyroll to
What are the IP(s) we need to block for Crunchyroll??
This appears to have worked for me. I entered the two lines on my mac mini. Prior to entering them i couldnt really even watch a youtube video. Afterwards I can watch 1080p youtube video easily.
BTW I am on Time Warner Cable in South Carolina. I have the standard 15Mdown 1M up connection and usually get REALLY good speedtest results. So, youtube not working is completely because of TWC throttling those CDN servers.
Why in the freaking world would they do that? Isnt that a violation of FCC Net Neutrality rules?
This worked for me! I love you man! However, can TWC do something similar to a game like Battlefield 3? I’ve been having horrible lag in BF3 for the same time as I’ve had problems with twitch and youtube. Thought maybe there was a connection there.
Ok so I copied both the commands under “Open up your terminal and run these commands (you will be prompted for the admin password):” – I pasted them in my terminal and was asked to input a admin password – I typed in the password (100% sure its correct even though I cant see any characters pop up when i type) – Hit enter and it gives me the “Wrong Password”. I don’t know what is wrong can somebody please help me. Youtube is extremely annoying atm
How about on a Chromebook?
Any way you can leave the exact command for undoing everything? It ended up making my youtube slower and I’m confused on how to undo it! Thank you.
Actually, Mitch’s post provided an example that is about as close to exactly the command to use as is possible. It’s not possible to give the completely exact command because that requires the reference numbers for the rules you created earlier and these numbers can be different on each computer. This is why it is necessary to:
1. Run “sudo ipfw list”
2. Read the list and determine the reference numbers for the two rules you created earlier
3. Run “sudo ipfw delete [reference number 1]” (replace [reference number 1] with the actual reference number)
4. Run “sudo ipfw delete [reference number 2]” (replace [reference number 2] with the actual reference number)
Hopefully this helps elaborate further on Mitch’s already excellent explanation. I’d provide an example of the output of the list command but I don’t have a Mac, yet this is much like techniques required in the Linux environment.
Thank you!!
These commands worked very well, unfortunately they caused YouTube’s full screen option to glitch up. Has anyone had a similar issue?
Can you publish a guide to how you found these two specific hosts to block? And what you hypothesize they do? I am in China and would like to follow your steps to find the hosts I should block, if possible.
Yes, a guide on this would be much appreciated. I’m not sure how likely it is that TWC will setup more of these servers in IP ranges not in the above blocks but it would be nice to know how to find this out should that happen in the future.
+1
+2
Sure, I can do a basic post on how to dig up the IP addresses, but I’ll be keeping it short and sweet, simply focusing on finding the IP address you want to block. I’ll leave out all the theory behind it for another day.
+3
I’ve been following this post’s comments…. can you give us a link to that when done?
+4
Does this work for uploads? I’m having an issue with my upload speeds going up and down and never stabilizing. I monitor my speeds with an application and I used to get a consistant upload speed the entire duration. now it goes up and down looking like the heart beat monitor of someone running. And it’s only YouTube. Vimeo and Blip.tv I get a constant speed of what I’m suppose to be getting.
If this won’t fix this issue, any ideas what could?
Every time restart my mac it deletes the rules. How do I make them stay?
Add them to the Mac’s start-up script.
In the Linux world it is “/etc/rc.local”. Google or an OSX help forum should point to the OSX equivalent.
what worked for me was internet protocol version; won’t reveal that here but whatever version you have, you can change DNS server to a faster one; change both, to include the alternate to a faster DNS; I switched, speed is better, even at 1080p, load time suped up drastically; also blocked the infamous address known used via Google/YouTube for cache load; you can also change Windows computer system file, where it might be programmed as a text; reconfigure it as an ini file, where it will work to include desktop under protocol as a main load in from computer fire up, rather than a log load and/or a file load to folder; it will see the browser as a priority same as any other file at desktop as an ini process; I didn’t need to do that but will if problems still occur for load in such as YouTube browser loads for their system(s)
This explanation appears to be wrong by my tests, not everyone should be blocking the same servers since these connections depend on the ISP and the region.
But most of the time these servers will be slow probably because the traceroutes seem to point to them being inside Google’s datacenter, they are more likely the original source, rather than the caching CDNs that peer directly with each ISP. So it seems the problem is that many times youtube will prefer going to the original google source rather than the more local cache so by blocking the the google’s data center servers you get the closer cache if youtube can find it after hunting awhile.
The problem I’ve had with this solution is that sometimes the video is just not on the cache server, and you end up with the snowscreen error message.
The Real soultion that youtube should implement is a record of which servers are faster than others, and over time it should pick the correct ones more often than not. So in the end it isn’t the ISPs fault, but google’s. If the ISP wanted to throttle youtube, it could do a better job and you’d never be able to watch youtube. More likely the series of tubes connecting to google’s datacenter are just clogged during primetime hours.
If the CDN is for TWC customers, then how is it that it makes a difference to people from other far flung regions of the world? Placebo effect?
Is this CDN for youtube? if that is so I would have expected Google to provide better experience.
Got to try this when I get back home and check the before and after speeds.
I’m on CenturyLink in AZ and this worked for me. This is the first time in about two years I’ve been able to watch a youtube video in 720/1080p without it stopping to buffer every 2 seconds. I’m on a 40/15 connection so I’ve been scratching my head over this for a while now.
Wouldn’t it be better to gather actual evidence of TWC throttling (didn’t see any sources here), and present it to both TWC and Google for comment? What do you do when/if the CDNs shift around to different IP subnets? Keep blocking entire /24s and /16s until you’ve eventually blocked yourself from Google almost entirely? Seems extreme but in the end I’d rather see a real root cause found and addressed by Google and/or ISPs.
Is there any reason I can’t just block these IP addresses with Little Snitch?
It seems easier.
Worked great for me using FiOS in New York. Videos take a second or two longer to load initially, but once it gets started, the loading is lightning fast.
I’m In America, using Comcast with Windows 8. It accepted the command but I haven’t noticed a major difference. Was quick to do though.
Does only TWC do this, or do other internet providers throttle Youtube videos and other downloads?
Hey Mitch, I need some help. When it asks for the admin password on terminal (Mac) I can’t type anything? I try pressing all buttons but it doesn’t work. Only thing that works is enter. I tried typing up my password then pressing enter but it just says “Wrong Password”
your won’t see the typing but it is typing the nothing that you see is the * marks when you actually type your password so just double check you didn’t mess up the password and do it a couple more times should work.
This is just how it displays, type your password and press enter it will work.
Worked on my firewall. TWC Business Class and I have had a horrible time specifically with Youtube. This seems to have fixed the issue for now. thanks.
Is there a step by step on how to do this through the wireless router since i have multiple devices like laptop, tablet and phones…?
Have you tried setting your Router DNS to use Google’s public address (8.8.8.8) instead of the ISP’s default? That seems to have eased some of the issues I was having.
Me too. I discovered this on my own, and was about to post it here. Directions: https://developers.google.com/speed/public-dns/docs/using
didn’t work for me here in germany… videos loaded much longer than without the rules… could it be that there are different ip-adresses used by cdn?
Yep, no good for me in Germany either. Blocking the…
173.194.55.0/24
…range just blocked most of the internet it seemed! Blocking the…
206.111.0.0/16
…range had, unfortunately, no measurable impact on streaming speeds whatsoever. My ISP is o2 (Alice).
Worked for me on o2 like a charm.
(blocked in comodo firewall)
o2/alice has google caching servers in its own network,
In most cases you should get connected to one of those and have rarely speed problems with youtube.
Im currently receiving videos from r5—sn-i5onxoxu-q0ne.c.youtube.com (85.182.250.144)
http://ip.robtex.com/85.182.250.144.html#whois
Hi, do you think this could work in France ?
We have the same issue here (crap performance on youtube and twitch.tv) with the provider named “Free” (it’s the real name don’t laugh).
However, i’m not sure we are using the same videos cache servers here. Do you know where i can find ips addresses for those servers in france?
can someone post how to do this through a router?
ty man u rock
Have you had any complaints from Comcast users?
After adding these to terminal, my videos take at least 20 seconds to start. Anyway around that?
But once the video starts, the whole video loads extremely fast and no buffering.
No way around it as I mentioned in the article. It’s a byproduct of the IP rejection handling process.
that could also be your DNS, not sure if this will work with the above but you could try to change to googles DNS servers 8.8.8.8 and 8.8.4.4. This *may* also help in general as Google often hosts a video on several servers and due to load balancing may give you different parts of one clip from several servers, each requiring a DNS lookup. Come to think of it, could different DNS settings also help bypass the CDN?
This worked wonders for me. I think Google’s DNS servers send me to a better IP address. Before I was getting a mix of slow loads and absolute failures about 10 seconds into a video. Now everything is streaming at 1080p without hiccups. Directions here: https://developers.google.com/speed/public-dns/docs/using