Skip to content

Instantly share code, notes, and snippets.

@martinrehfeld
Forked from rkh/a.md
Created July 3, 2012 08:58

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:

  • Netflix
  • 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/149.154.158.186
server=/fox.com/theplatform.com/akamaihd.net/chartbeat.com/149.154.158.186
server=/tunlr.net/149.154.158.186
server=/pandora.com/149.154.158.186
server=/hulu.com/149.154.158.186
server=/cbs.com/149.154.158.186
server=/netflix.com/149.154.158.186
server=/abc.com/go.com/149.154.158.186
server=/tv.com/149.154.158.186
server=/pbs.com/149.154.158.186
server=/vevo.com/fwmrm.net/149.154.158.186
server=/thewb.com/149.154.158.186
server=/cwtv.com/149.154.158.186
server=/mylifetime.com/scorecardresearch.com/doubleclick.net/rubiconproject.com/cpxinteractive.com/adnxs.com/brightcove.com/cpxadroit.com/atdmt.com/serving-sys.com/149.154.158.186
server=/crackle.com/149.154.158.186
server=/last.fm/149.154.158.186
server=/turntable.fm/149.154.158.186
server=/mog.com/149.154.158.186
server=/iheart.com/149.154.158.186
server=/bbc.co.uk/149.154.158.186
server=/channel4.com/149.154.158.186
server=/itv.com/149.154.158.186
server=/zattoo.com/149.154.158.186
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment