Skip to content

Instantly share code, notes, and snippets.

@cdhowie cdhowie/
Last active Jul 17, 2019

What would you like to do?
DNS proxy to fix Netflix stupidity

This comment has been minimized.

Copy link

Kline- commented Jun 6, 2016

Thanks for this, I'm not a Python guy at all -- any help with this? I had your script setup to run in place of my local BIND instance and to then forward requests to BIND afterwards.

Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 2859, in datagramReceived
    self.controller.messageReceived(m, self, addr)
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 554, in messageReceived
    self.handleQuery(message, proto, address)
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 381, in handleQuery
    return self.resolver.query(query).addCallback(
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 73, in query
    return defer.maybeDeferred(method,, timeout)
---  ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 81, in lookupAddress
    return self._lookup(name, dns.IN, dns.A, timeout)
  File "/usr/lib/python2.7/dist-packages/twisted/names/", line 79, in _lookup
    d = self.resolvers[0].query(q, timeout)
  File "./netflix-aaaa-filter", line 35, in query
    if self.__shouldBlock(query):
  File "./netflix-aaaa-filter", line 30, in __shouldBlock
    penultimateDomainPart ='.')[-2]
exceptions.IndexError: list index out of range

This comment has been minimized.

Copy link

stevesteffler commented Jun 7, 2016

Any idea how to do the opposite, i.e. force netflix to in no way use IPv4? It appears that if I run only IPv6 and no IPv4 I do not get the geo-blocking errors, it only detects dual-stack configurations. Running a client IPv6-only also is perfectly acceptable. (preferable in my case)


This comment has been minimized.

Copy link
Owner Author

cdhowie commented Jun 7, 2016

@Kline- Please try the latest version, I believe I have fixed this.

@stevesteffler In, just replace dns.AAAA with dns.A.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.