Skip to content

Instantly share code, notes, and snippets.

@rkh
Created June 29, 2012 07:26
Show Gist options
  • Save rkh/3016464 to your computer and use it in GitHub Desktop.
Save rkh/3016464 to your computer and use it in GitHub Desktop.

This allows you to use the following video streaming services outside of the US from your Mac without having to use a proxy or VPN, so no big bandwidth issues:

  • Hulu / HuluPlus
  • CBS
  • ABC
  • MTV
  • theWB
  • CW TV
  • Crackle
  • NBC
  • FOX
  • TV.com
  • PBS
  • Vevo
  • History
  • Lifetime TV
  • Pandora
  • Last.fm
  • Turntable.fm
  • MOG.com
  • iHeartRadio

And it also adds access to the following Non-US services:

  • BBC iPlayer
  • Channel4 4oD
  • iTV Player
  • Zattoo

It will also resolve any *.dev address to point to 127.0.0.1.

It's basically routing all DNS requests for these services to tunlr, but any other requests to a local DNS (tries 192.168.0.1 and 192.168.178.1) or a global one (Google's DNS and OpenDNS). That way you won't get hit by tunlr's traffic shaping but don't have to switch your DNS settings all the time. Pro tip: If you're not in the US or Europe, add your ISP's DNS server to allow those Geo-DNS optimizations to kick in. Adding more should be trivial, just check out the config.

Tested on Lion in Germany. The dnsmasq.conf should also be usable on a router.

# See /usr/local/Cellar/dnsmasq/2.61/dnsmasq.conf.example for more
address=/dev/127.0.0.1
listen-address=127.0.0.1
server=/mtv.com/mtvnservices.com/fwmrm.net/google-analytics.com/imrworldwide.com/demdex.net/scorecardresearch.com/quantserve.com/doubleclick.net/chartbeat.com/184.82.222.5
server=/fox.com/theplatform.com/akamaihd.net/chartbeat.com/184.82.222.5
server=/tunlr.net/184.82.222.5
server=/pandora.com/184.82.222.5
server=/hulu.com/184.82.222.5
server=/cbs.com/184.82.222.5
server=/netflix.com/184.82.222.5
server=/abc.com/go.com/184.82.222.5
server=/tv.com/184.82.222.5
server=/pbs.com/184.82.222.5
server=/vevo.com/fwmrm.net/184.82.222.5
server=/thewb.com/184.82.222.5
server=/cwtv.com/184.82.222.5
server=/mylifetime.com/scorecardresearch.com/doubleclick.net/rubiconproject.com/cpxinteractive.com/adnxs.com/brightcove.com/cpxadroit.com/atdmt.com/serving-sys.com/184.82.222.5
server=/crackle.com/184.82.222.5
server=/last.fm/184.82.222.5
server=/turntable.fm/184.82.222.5
server=/mog.com/184.82.222.5
server=/iheart.com/184.82.222.5
server=/bbc.co.uk/184.82.222.5
server=/channel4.com/184.82.222.5
server=/itv.com/184.82.222.5
server=/zattoo.com/184.82.222.5
server=/mtv.com/mtvnservices.com/fwmrm.net/google-analytics.com/imrworldwide.com/demdex.net/scorecardresearch.com/quantserve.com/doubleclick.net/chartbeat.com/199.167.30.144
server=/fox.com/theplatform.com/akamaihd.net/chartbeat.com/199.167.30.144
server=/tunlr.net/199.167.30.144
server=/pandora.com/199.167.30.144
server=/hulu.com/199.167.30.144
server=/cbs.com/199.167.30.144
server=/netflix.com/199.167.30.144
server=/abc.com/go.com/199.167.30.144
server=/tv.com/199.167.30.144
server=/pbs.com/199.167.30.144
server=/vevo.com/fwmrm.net/199.167.30.144
server=/thewb.com/199.167.30.144
server=/cwtv.com/199.167.30.144
server=/mylifetime.com/scorecardresearch.com/doubleclick.net/rubiconproject.com/cpxinteractive.com/adnxs.com/brightcove.com/cpxadroit.com/atdmt.com/serving-sys.com/199.167.30.144
server=/crackle.com/199.167.30.144
server=/last.fm/199.167.30.144
server=/turntable.fm/199.167.30.144
server=/mog.com/199.167.30.144
server=/iheart.com/199.167.30.144
server=/bbc.co.uk/199.167.30.144
server=/channel4.com/199.167.30.144
server=/itv.com/199.167.30.144
server=/zattoo.com/199.167.30.144
server=192.168.0.1
server=192.168.178.1
server=8.8.8.8
server=8.8.4.4
server=208.67.222.222
server=208.67.220.220
#!/bin/bash -ex
# makes sure you have homebrew installed
which brew >/dev/null || ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# installs and configures dnsmasq
brew install dnsmasq
curl -o /usr/local/etc/dnsmasq.conf https://raw.github.com/gist/3016464/dnsmasq.conf
# see `brew info dnsmasq` if you run into issues here
sudo cp /usr/local/Cellar/dnsmasq/2.61/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
# try if it works, should resolve to 127.0.0.1
# if it doesn't, try `/usr/local/sbin/dnsmasq --no-daemon` to see what's going on
nslookup local.dev 127.0.0.1
# set up for Wi-Fi, Ethernet and Display Ethernet (Thunderbolt display)
# if you have a different device, either use Network Settings or check
# `networksetup -listallnetworkservices`
sudo networksetup -setdnsservers "Wi-Fi" 127.0.0.1 || true
sudo networksetup -setdnsservers "Ethernet" 127.0.0.1 || true
sudo networksetup -setdnsservers "Display Ethernet" 127.0.0.1 || true
# Flush local DNS cache
dscacheutil -flushcache
# You might need to restart your browser
@judofyr
Copy link

judofyr commented Jun 29, 2012

I can't get Turntable.fm to work. I get a 500 error from chat5.turntable.fm. DNS problem or Turntable's problem?

@rkh
Copy link
Author

rkh commented Jun 29, 2012

Dunno. Try setting your DNS to 199.167.30.144. If it works, then some entry is missing.

@rkh
Copy link
Author

rkh commented Jun 29, 2012

Oh, you also wanna flush your DNS cache and restart your browser: dscacheutil -flushcache

@resistorsoftware
Copy link

This is awesome! Thanks!

@pixelkritzel
Copy link

This sounds great.
If you are in Germany, you know the trouble between YouTube and GEMA.
Would you try to include YouTube too?

@rkh
Copy link
Author

rkh commented Jun 29, 2012

@imazined I use ProxTube.

@rkh
Copy link
Author

rkh commented Jun 30, 2012

Apparently NBC doesn't work.

@KTamas
Copy link

KTamas commented Jul 1, 2012

Last.fm stopped working here :(

Edit: then it came back again. weird.

Edit 2: The links for the radio are back but the stations don't start.

@rkh
Copy link
Author

rkh commented Jul 2, 2012

I'll investigate NBC and Last.fm when I have time. It might have been other hiccups, large parts of the internet had major issues, with first AWS having another outage and then that leap second thing.

@resistorsoftware
Copy link

This is so fun. My Desktop gets Netflix US, but now my PS3 is restricted to the same old same old Canada only... any tips on how to fool the PS3?

@rkh
Copy link
Author

rkh commented Jul 5, 2012

Set up OpenWRT or something like that on your router and install dnsmasq on there.

@resistorsoftware
Copy link

Ack thpfft... OpenWRT supports D-Link 600 and 615 but not my 655 even though I have a B1 revision firmware... !!! Blast it... might have to look for a cheap router out there to experiment with...one on the hack list.

@bitboxer
Copy link

Somehow now facebook and twitter stopped working for me :( .

$> ping fbcdn-profile-a.akamaihd.net         
ping: cannot resolve fbcdn-profile-a.akamaihd.net: Unknown host

He can't resolve akamaihd.net anymore?!

@bastien
Copy link

bastien commented Aug 21, 2012

@bitboxer did you by any chance updated dnsmasq and forgot to update the deamon plist?

@bitboxer
Copy link

I updated dnsmasq to 2.62. Just removed everything and reinstalled 2.62, but still not working :( . Is this an issue with 2.62?

@bastien
Copy link

bastien commented Aug 22, 2012

Actually I have the same issue with 2.62

@moonglum
Copy link

Removed dnsmasq, removed all configurations, redid the script from above – still have the same problem @bitboxer has!

@bitboxer
Copy link

Looks like @fhemberger has the same problem :(

@fhemberger
Copy link

Tried the following with dnsmasq 2.61:
Commented out line 7 and 31.

sudo killall dnsmasq
dscacheutil -flushcache

Twitter.com works again.

@jtarchie
Copy link

jtarchie commented Sep 1, 2012

This is awesome. I've used this within the US for the UK channels. Doctor Whohoo!

@rkh
Copy link
Author

rkh commented Sep 10, 2012

I updated it with the new DNS server addresses.

@rkh
Copy link
Author

rkh commented Sep 29, 2012

@Anna12
Copy link

Anna12 commented Oct 2, 2012

I was a user of tunlr till yesterday when they dropped Netflix. I understand them creating limited viewing time fort heir users but dropping a service altogether is sad:(

I went back to unotelly (same service but paid) and am happy with them since. They also have some coupons for users coming from tunlr but couldn't make use of it because i already had a year long subscription. But it might still help some other !
The coupon is: iheartnetflix

@KTamas
Copy link

KTamas commented Jan 1, 2013

I've started to have problems with facebook images running this. Actually, having problems with files served from akamaihd.net

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