Skip to content

Instantly share code, notes, and snippets.

@rkh
Created June 29, 2012 07:26
Show Gist options
  • Star 94 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • 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
@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