Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

Convert query to lower case before compare #22

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env python
#!/usr/bin/env python3

OPTIONS = {
# Port to bind to.
'listen-port': 53,
'listen-port': 2053,

# Address to bind to. '::' will bind IPv6; make sure bindv6only is 0 in
# your sysctl configuration for this binding to service IPv4 clients, too.
Expand All @@ -14,7 +14,7 @@

# Specify one or more servers to proxy to. Note that Twisted may not be
# happy if you use an IPv6 address.
# 'upstream-dns': [('127.0.0.1', 10053)],
'upstream-dns': [('1.1.1.1', 53), ('1.0.0.1', 53)],

# Specify a resolv.conf file from which to read upstream nameservers. As
# noted above, if you have any upstream IPv6 servers, Twisted may not be
Expand Down Expand Up @@ -45,7 +45,7 @@ def __shouldBlock(self, query):
return False
penultimateDomainPart = parts[-2]

return query.type == dns.AAAA and penultimateDomainPart in (b'netflix', b'nflximg', b'nflxext', b'nflxvideo', b'nflxso')
return query.type == dns.AAAA and penultimateDomainPart.lower() in (b'netflix', b'nflximg', b'nflxext', b'nflxvideo', b'nflxso')

def query(self, query, timeout=None):
if self.__shouldBlock(query):
Expand Down