Skip to content

Instantly share code, notes, and snippets.

@cdhowie cdhowie/README.md
Last active Jul 17, 2019

Embed
What would you like to do?
DNS proxy to fix Netflix stupidity
@Kline-

This comment has been minimized.

Copy link

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/dns.py", line 2859, in datagramReceived
    self.controller.messageReceived(m, self, addr)
  File "/usr/lib/python2.7/dist-packages/twisted/names/server.py", line 554, in messageReceived
    self.handleQuery(message, proto, address)
  File "/usr/lib/python2.7/dist-packages/twisted/names/server.py", line 381, in handleQuery
    return self.resolver.query(query).addCallback(
  File "/usr/lib/python2.7/dist-packages/twisted/names/common.py", line 73, in query
    return defer.maybeDeferred(method, query.name.name, timeout)
---  ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
    result = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/twisted/names/common.py", line 81, in lookupAddress
    return self._lookup(name, dns.IN, dns.A, timeout)
  File "/usr/lib/python2.7/dist-packages/twisted/names/resolve.py", 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 = query.name.name.split('.')[-2]
exceptions.IndexError: list index out of range
@stevesteffler

This comment has been minimized.

Copy link

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)

@cdhowie

This comment has been minimized.

Copy link
Owner Author

commented Jun 7, 2016

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

@stevesteffler In server.py, 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.