Netflix Gateway – DNS solution aka Look what I cobbled together



This information is provided as is without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. In no event shall the author be liable for any damages whatsoever including direct, indirect, incidental consequential, loss of business profits, or special damages.
I do not profess that I am a Linux guru or that this setup will even work for you. As a matter of fact its likely that by the time your read this its out of date and probably does not work anymore.

The Project

I only set this up  as a learning experience, I saw people offering this service for around USD $5/month and thought to myself ” If there a re several hosts offering this service I can build it… VPS‘s are cheap”. So I set out to get something working.

 The Ingredients

For this cake to bake all nice and fluffy you will need the following:

  • A VPS thats close to you. I would recommend ChicagoVPS. At the time of writing you could get a decent VPS close to you for around USD $10/year. Please use this referral link and help me out.
  • Linux (For this project I chose Debian Wheezy 7.0)
  • DNS Server – I chose Bind9 (installed and configured).
  • Proxy Server – HAProxy (installed and configured).
  • A static IP address
  • Maybe some other stuff I will add when I remember

You are going to need some kind of text editor, my editor of choice for this is nano
For this tutorial I am probably going to take some shortcuts and if you don’t get something or can’t follow my instructions then its probably going to better that you find another tutorial.
First of all make sure you OS is up to date

apt-get update && apt-get upgrade

If you don’t have nano installed

apt-get install nano

Edit /etc/bind/named.conf.local

include “/etc/bind/rndc.key”;
include “/etc/bind/zones.override”;
acl “trusted” {; // Internal IPv4 Address of your VPS; // Internal Loopback IP ;// Your home internets IP address

Edit /etc/bind/zones.override

zone “” {
type master;
file “/etc/bind/db.override”;
zone “” {
type master;
file “/etc/bind/db.override”;
zone “” {
type master;
file “/etc/bind/db.override”;

 Edit /etc/bind/db.override

You will need to replace with the IP of your VPS.

; BIND data file for overridden IPs
$TTL  86400
@   IN  SOA ns1 root (
2015030401  ; serial
604800      ; refresh 1w
86400       ; retry 1d
2419200     ; expiry 4w
86400       ; minimum TTL 1d
@   IN  NS  ns1
ns1 IN  A
@   IN  A
*   IN  A

Edit /etc/bind/named.conf.options

options {
directory “/var/cache/bind”;
forwarders {
# these are the DNS servers from the VPS provider (look in /etc/resolv.$;
auth-nxdomain no;    # conform to RFC1035
listen-on-v6 { any; };
allow-query { trusted; };
allow-recursion { trusted; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;


Proxy setup pending…..

By arkique