This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.
Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. It became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifying the tunnel services and their geographical origin. The problem was further compounded by certain opportunstic indiviuals deciding to create a business model out of providing the Netflix US content library via networks like Hurricane Electric and ruined it for everyone. Netflix and friends got all stressy about it and now all IPv6 tunnel users are considered naughty proxy pirates. Also because big media is stuck in the 1990s, they think this block is actually effective, when in fact it just inconveniences legit users.
https://help.netflix.com/en/node/277
In order to maintain keeping your IPv6 tunnel active while browsing Netflix, you must force Netflix to always use IPv4 (which is likely to be using your ISP WAN gateway as normal). Despite Netflix support stating you should simply "disable" your IPv6 tunnel, this is impossible when you have a IPv6 tunnel deployed across a LAN at the router level and have servers and services running over v6.
To implement such a workaround you'll need to have a DNS setup that can allow you to conditionally forward specific Netflix domain lookups to a special DNS resolver that can strip AAAA (IPv6 addresses) records from the DNS request, essentially forcing IPv4 connections.
This guide focuses on a setup of dnsmasq (the main DNS resolver) and bind9 (An additional resolver that strips any AAAA records from DNS lookups sent to it). The concept however is pretty standard and can be applied to setups using different software.
These are the key Netflix domains that need to be forwarded.
- netflix.com
- netflix.net
- nflxvideo.net
- nflximg.net
- nflxext.com
Some domains may not have AAAA records currently, but its possible this might change in the future, so they are covered off to be future proofed.
# Remove AAAA responses from Netflix DNS requests
server=/netflix.com/127.0.0.1#2053
server=/netflix.net/127.0.0.1#2053
server=/nflxext.com/127.0.0.1#2053
server=/nflximg.com/127.0.0.1#2053
server=/nflxvideo.net/127.0.0.1#2053
In this example, we are creating conditional forwarders for the above domains to be sent to another DNS server running on the same box, but running on a non-standard DNS port to avoid conflicting with Dnsmasq. You can host the additional DNS server anywhere you like, you can also run multiple servers if you like redundancy. Personally, I host mine on my router (DD-WRT), its always on, it makes sense. You can of course also use the standard DNS port if your setup allows for it, which in this case you can simply remove the #2053 part from each line, or choose a random port higher than 1024 for DNS traffic to go through.
This is a very minimal configuration for bind. Its one purpose is basically to strip AAAA records from DNS lookups. It has the advantage of being domain agnostic, meaning it will strip any AAAA records from any domain passed to it. This is useful if other services other than Netflix start blocking IPv6 tunnels in a similar fashion.
You can use any forwarders you like, the example below uses OpenDNS. If you are running this on an external IP address, you should be careful and make you only allow recursion on specific requests and ACL accordingly. Not doing so will make you an open DNS resolver, it won't take long for someone to start abusing your server and generating a high rate of traffic.
options {
directory "/tmp";
forwarders {
208.67.222.222;
208.67.220.220;
};
forward only;
dnssec-enable no;
auth-nxdomain no;
listen-on port 2053 { 127.0.0.1; };
// listen-on-v6 port 2053 { ::1; };
filter-aaaa-on-v4 yes;
};
The --enable-filter-aaaa option must be enabled at compile time in order for this config to work, see this page for more information:
https://kb.isc.org/article/AA-00576/0/Filter-AAAA-option-in-BIND-9-.html
If you want to run BIND like this on OpenWRT/DD-WRT you may have to compile the bind package yourself with this specific compile flag set, depending on your setup.
As of 08/01/2017, OpenWRT updated the bind package to have this enabled by default. Entware-ng will also inherit this change on their next sync with OpenWRT sources.
If you need to compile bind from source, see this excellent guide below:
https://www.ploek.org/post/netflix_openwrt/
Note: DD-WRT is also mostly compatible with nearly all Entware-ng packages.
Once everything is setup, you can query any of the following Netflix domains listed above against a public DNS resolver and compare the output to a query made to the special DNS resolver you've setup.
Google's public DNS servers will always return AAAA records, this is what it would look like:
dig @8.8.8.8 netflix.com AAAA
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> @8.8.8.8 netflix.com AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21293
;; flags: qr rd ra; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;netflix.com. IN AAAA
;; ANSWER SECTION:
netflix.com. 59 IN AAAA 2620:108:700f::36d6:fc9
netflix.com. 59 IN AAAA 2620:108:700f::36d6:177c
netflix.com. 59 IN AAAA 2620:108:700f::36d6:fed
netflix.com. 59 IN AAAA 2620:108:700f::36d6:25bf
netflix.com. 59 IN AAAA 2620:108:700f::36d6:d62
netflix.com. 59 IN AAAA 2620:108:700f::36d6:1cd2
netflix.com. 59 IN AAAA 2620:108:700f::36d6:22b2
netflix.com. 59 IN AAAA 2620:108:700f::36d6:1699
;; Query time: 36 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Nov 25 12:51:43 GMT 2016
;; MSG SIZE rcvd: 264
Making the same request to our bind9 server, we should get no AAAA records returned even we explicitly requesting them.
dig @127.0.0.1 netflix.com AAAA
; <<>> DiG 9.9.9-P3 <<>> @127.0.0.1 netflix.com AAAA
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36923
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;netflix.com. IN AAAA
;; Query time: 130 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Nov 25 12:51:43 GMT 2016
;; MSG SIZE rcvd: 40
If you get no AAAA records returned on your DNS resolver, your in business. Future Netflix connections should now only use IPv4. You may want to reboot your router or device supplying DNS in order to clear existing/cached lookups. If you performed a DNS lookup for a Netflix domain with AAAA records recently prior to implementing this workaround, it may still be cached and can take a bit of time for changes to be reflected on client machines on the network.
If you get issues like timeouts, check to make sure the DNS server is actually running and your firewall is permitting the DNS traffic, especially if using a non-standard port for DNS traffic.
Chromecast devices don't allow direct control of the DNS servers used and always try to use Google's Public DNS resolvers of 8.8.8.8 and 8.8.4.4, these of course will return AAAA records and cause issues when streaming Netflix (even if you have implemented this workaround on the network the stream is coming from). You can however leverage a fallback option built into Chromecast devices, where by if you block access to the Google Public DNS resolvers, it forces the Chromecast device to use the DHCP supplied DNS information and hence the DNS workaround will work.
An example of doing this with iptables:
iptables -I FORWARD --destination 8.8.8.8 -j REJECT
iptables -I FORWARD --destination 8.8.4.4 -j REJECT
REJECT is a bit more friendly than DROP in this case, as the "fail" response will be quicker.
If you happen to use Google's DNS resolvers at the network level for general DNS queries you can limit this block to the IP address of your Chromecast device with the -s option, allowing you to use Google's DNS resolvers for other devices still. This would require you to use static DHCP in order to create a fixed LAN IP address for any Chromecast devices you have, so you know where they are on the network.
Enjoy your Netflix again!
In case you have any questions about the purpose/reasons for this workaround, here's some answers to potential questions you might have.
Q. Will I be able to stop using this workaround at some point?
A. Once your ISP provides a native IPv6 subnet to you, you can disable your IPv6 tunnel and use the IPv6 subnet delegated to you by your ISP (likely a /56 or something similar).
To clarify, Netflix is only blocking IPv6 tunnels because it cannot fully confirm your exact country of origin and sees any usage of a IPv6 tunnel as a way of circumventing geo-restrcitions on content that is licensed to specific countries, despite this being the intention or not. In the case of Hurricane Electric, while it operates tunnels in loads of different countries, the IPv6 address space they have ultimately identifies as US to a lot of geo based systems concerning IPv6. This problem however is now redundant as Netflix has now straight blocked the IPv6 ranges of various IPv6 tunnel services.
Q. Will Netflix block my actual ISP?
A. No. When you use your ISPs connection, the IP address you connect from will essentially be on whitelist as Netflix won't block the IPv4/IPv6 space of a registered residental/business ISP as its server locations will be fixed and registered. The exception to this is known VPN/proxy services, these are being added to Netflix's blocklists and it gets updated regularly.
Q. How does this workaround work?
A. Essentially when a request is sent to Netflix, a IPv6 connectivity test is done to confirm if you can use their IPv6 network. Remeber, the default protocol behaviour is to try IPv6 first (happy eyeballs). We are essentially fooling Netflix into making all requests use their IPv4 network, because we stripped any AAAA records from such requests, making it look like we only have IPv4 connectivity. Sneaky, yet effective. Netflix traffic goes over IPv4, while you get to keep your IPv6 connectivity for everything else and be part of the slowly rising IPv6 traffic level of the world. Bonus!
Q. Will this workaround stop working in the future?
A. It should be pretty robust, but if Netflix introduce a new domain not covered in the list above that has some form of IPv6 connectivity, which then determines proxy/VPN usage, it may have to be expanded, I have personally used this workaround since June 2016 and it hasn't let me down yet. To be fair this block has been implemented for sometime now, which should satisfy big media, if Netflix further tinker with it, it's just going to become a game of cat and mouse.
Q. Does this workaround allow me to bypass geo-restrictions?
A. No. It is simply designed to allow connectivity to Netflix, while having an IPv6 tunnel active. This does not allow you to obtain access to library content outside your region. This is basically the reason why this workaround has to be implemented in the first place for us legit IPv6 tunnel users. This is why we can't have nice things!
Q. Will Netflix unblock IPv6 tunnels in the future?
A. Probably not, they were likely pressured into it in the first place by media companies and license holders. Netflix probably don't care that much either, as long as your paying your monthly subscription. Big media didn't like it though! Hence the ban hammer. Its also worth noting that IPv6 tunnel services are transitional mechanisms and shouldn't be a permanent solution for IPv6. Hassle your ISP to sort out their IPv6 (or lack of!).
Q. Do any proxy/VPN services still work with Netflix?
A. There are likely some services that might still work, but they are likely operating on borrowed time, as Netflix will be monitoring and updating their blocklists regularly. Most of the well known proxy/VPN services will be blocked for sure.
Q. Can I forward other non-Netflix domains using this method?
A. Yes. The way the bind9 config is setup is basically to strip any AAAA records from domains passed to it. It is not limited to Netflix domains. You just need to let your primary DNS server/resolver (in this example, Dnsmasq) know to forward it to somewhere else. This is the main reason why I'd recommend going the slightly more technical route for more benefits with bind9. Its an even better solution if you already run a bind9 DNS server and simply can create conditional forwarders directly on your primary bind9 servers, but that's not an essential requirement, as explained above.
For a real non-Netflix example, mega.co.nz or mega.nz will not work over v6 via Hurricane Electric because MEGA uses Cogent to carry their IPv6 traffic, which lacks any route to the Hurricane Electric network. See this thread on the HE forums: https://forums.he.net/index.php?topic=3530.0 about the whole HE vs Cogent saga. Using this workaround for MEGA domains will allow you to access the service, because IPv4 will essentially be forced.
Q. I'm not able to run bind9, are there any alternatives?
A. Yes. There is a excellent lightweight DNS proxy specifically for Netflix IPv6 tunnel purposes. Written in Python, it should work on most Unix/Linux systems with little setup required.
https://github.com/cdhowie/netflix-no-ipv6-dns-proxy
The same concept applies, you need to have your primary DNS server/resolver forward requests to this proxy, be aware this DNS proxy is specifically for Netflix domain usage and won't strip the AAAA records of other domains if sent to it. You can edit the source code to expand it if you wanted to though.
Q. Who is "big media"?
A. My pet name for the media rights corporations who are stuck in the past and don't know jack shit about technology. Much like the government of the United Kingdom (example: Investigatory Powers Act 2016). True story.