From 5687ebf9766333722d67a92010af9279daf74ba3 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Wed, 15 Sep 2021 11:44:51 +0200 Subject: [PATCH] new: Include dnscrypt-resolvers IP addresses to public-dns lists --- lists/public-dns-v4/list.json | 236 ++++++++++++++++++++++++++-------- lists/public-dns-v6/list.json | 37 +++++- tools/generate-publicdns.py | 55 ++++++-- 3 files changed, 259 insertions(+), 69 deletions(-) diff --git a/lists/public-dns-v4/list.json b/lists/public-dns-v4/list.json index 722f51d..c84a0bf 100644 --- a/lists/public-dns-v4/list.json +++ b/lists/public-dns-v4/list.json @@ -5,24 +5,8 @@ "1.0.0.3", "1.1.1.1", "1.1.1.2", - "1.33.184.104", - "1.33.184.105", - "1.33.184.118", - "1.33.184.148", - "1.33.184.156", - "1.33.184.173", - "1.33.184.176", - "1.33.184.188", "1.33.184.194", "1.33.184.219", - "1.33.184.224", - "1.33.184.229", - "1.33.184.238", - "1.33.184.243", - "1.33.184.245", - "1.33.184.247", - "1.33.184.92", - "1.33.184.95", "101.255.56.249", "103.116.159.150", "103.121.228.1", @@ -31,17 +15,15 @@ "103.154.241.252", "103.198.131.226", "103.203.133.66", + "103.21.194.19", "103.226.174.4", "103.226.174.7", "103.23.150.89", "103.23.22.143", - "103.232.35.101", - "103.232.65.73", "103.244.159.82", "103.3.75.102", "103.3.75.90", "103.30.244.89", - "103.30.245.73", "103.30.247.73", "103.85.104.36", "103.85.104.38", @@ -49,9 +31,14 @@ "103.85.107.101", "103.86.96.100", "103.86.99.100", + "104.155.237.225", + "104.238.186.192", + "104.255.175.2", "105.30.247.93", "105.96.43.54", "106.240.228.50", + "107.13.161.169", + "107.13.224.225", "107.155.83.188", "108.179.34.214", "109.123.19.5", @@ -63,6 +50,8 @@ "109.234.248.8", "109.7.126.78", "109.70.132.17", + "109.70.207.146", + "109.70.207.43", "109.71.42.228", "110.172.55.126", "113.196.55.130", @@ -70,11 +59,14 @@ "114.130.5.5", "114.130.5.6", "114.34.162.81", + "114.4.109.102", "114.4.110.164", "115.178.73.100", "116.212.96.75", "116.48.150.197", "116.90.165.50", + "118.27.108.140", + "119.201.155.161", "12.127.17.72", "121.128.168.1", "121.254.134.99", @@ -86,12 +78,6 @@ "123.30.184.132", "124.219.29.129", "124.219.73.220", - "124.6.164.69", - "124.6.165.193", - "124.6.169.35", - "124.6.174.103", - "124.6.187.38", - "124.6.188.203", "128.238.2.38", "129.250.35.250", "130.185.242.224", @@ -99,20 +85,31 @@ "130.226.161.34", "131.100.36.162", "131.196.220.10", + "133.130.118.103", + "135.181.193.222", + "136.228.160.250", + "136.244.97.114", + "137.220.59.62", "137.82.1.1", "138.36.1.14", "138.78.49.150", "138.97.84.3", "139.130.4.4", "139.134.5.51", + "139.162.112.47", "14.63.217.213", + "140.238.215.192", "142.165.78.223", - "144.76.157.242", + "142.4.204.111", + "142.4.205.47", + "143.244.33.74", + "143.244.33.90", "144.76.83.104", "147.78.3.252", "149.112.112.112", "149.112.112.9", - "151.115.56.180", + "149.56.14.159", + "149.56.228.45", "151.196.0.37", "151.197.0.37", "151.197.0.38", @@ -125,9 +122,9 @@ "151.202.0.85", "151.80.222.79", "152.101.4.130", + "152.179.138.58", "153.142.244.29", "153.142.244.46", - "153.19.105.120", "154.32.107.18", "154.32.109.18", "154.72.197.138", @@ -141,28 +138,46 @@ "159.134.248.17", "159.69.114.157", "160.119.209.148", + "161.184.219.211", "161.200.96.9", "162.243.19.47", "162.245.221.19", "162.247.147.98", + "163.172.180.125", + "163.44.154.144", "164.163.1.90", + "164.68.121.162", "164.77.245.34", "165.16.68.1", + "165.232.32.95", "165.246.10.2", "165.87.13.129", "165.87.201.244", "166.102.165.32", + "167.114.220.125", "168.126.63.2", "168.187.46.242", "168.95.192.1", "169.255.152.118", + "169.53.182.124", "170.210.83.110", "170.239.144.20", "170.56.58.53", "171.25.229.166", "172.104.59.35", + "172.104.93.80", "172.105.162.206", + "172.105.166.189", + "172.116.15.120", + "173.11.131.1", "173.167.215.57", + "173.199.126.35", + "173.234.56.115", + "173.66.126.84", + "174.108.158.232", + "174.108.222.147", + "174.138.21.128", + "174.99.18.188", "175.103.48.7", "176.103.130.130", "176.103.130.131", @@ -171,6 +186,9 @@ "176.103.66.101", "176.110.8.17", "176.221.23.252", + "176.56.237.171", + "176.9.136.236", + "176.9.199.158", "176.94.20.4", "177.104.127.114", "177.135.204.163", @@ -184,11 +202,14 @@ "177.92.0.90", "177.92.1.35", "178.150.45.81", + "178.17.127.1", + "178.216.201.128", "178.22.113.198", "178.237.150.2", "178.248.160.140", "179.109.15.42", "179.60.235.209", + "180.180.247.37", "180.180.247.42", "180.76.76.76", "180.94.94.195", @@ -198,22 +219,33 @@ "182.93.18.83", "182.93.18.84", "184.149.50.25", + "184.55.4.145", "184.71.101.186", "185.107.80.84", "185.112.147.95", + "185.134.196.54", "185.161.112.33", "185.161.112.34", + "185.183.106.83", "185.184.222.222", - "185.20.163.2", + "185.22.154.19", + "185.228.168.10", + "185.228.168.168", "185.228.168.9", "185.228.169.9", + "185.231.182.126", "185.233.106.232", + "185.235.60.1", + "185.253.154.66", + "185.34.21.5", "185.38.27.139", "185.51.200.10", - "185.52.0.55", "185.55.225.25", + "185.66.143.178", + "185.70.196.151", "185.82.126.226", "186.120.184.35", + "186.148.128.86", "186.194.224.82", "186.211.1.191", "186.215.128.142", @@ -228,6 +260,7 @@ "186.56.59.251", "187.6.84.178", "187.75.155.116", + "188.118.227.21", "188.225.179.158", "188.227.240.58", "188.68.53.22", @@ -243,8 +276,8 @@ "190.151.144.21", "190.151.20.146", "190.151.20.148", + "190.192.166.130", "190.211.104.93", - "190.54.120.23", "190.56.163.189", "190.64.140.243", "190.64.66.218", @@ -253,6 +286,8 @@ "192.169.192.162", "192.221.134.0", "192.221.135.0", + "192.232.128.20", + "192.53.175.149", "192.76.144.66", "192.99.195.130", "192.99.195.133", @@ -263,9 +298,12 @@ "193.183.98.66", "193.19.64.88", "193.190.213.42", + "193.191.187.107", + "193.200.43.25", "193.200.69.242", "193.231.236.25", "193.251.169.83", + "193.37.255.227", "193.58.204.59", "193.89.248.1", "194.145.240.7", @@ -287,18 +325,20 @@ "195.10.195.195", "195.110.24.248", "195.112.96.34", + "195.12.48.171", "195.129.12.122", "195.129.12.83", - "195.138.74.246", "195.162.8.154", "195.186.1.107", + "195.186.1.162", + "195.186.4.107", "195.186.4.109", "195.186.4.111", "195.186.4.192", "195.189.130.1", "195.189.150.37", - "195.202.147.102", "195.204.130.85", + "195.208.5.1", "195.243.99.35", "195.250.58.10", "195.252.95.208", @@ -313,11 +353,12 @@ "196.13.158.51", "196.3.132.153", "198.180.150.12", + "198.24.75.66", "198.50.212.61", "198.82.247.34", - "199.166.6.2", "199.2.252.10", "199.255.137.34", + "199.27.185.149", "199.85.126.10", "2.228.121.163", "200.105.133.162", @@ -356,6 +397,7 @@ "200.99.138.103", "201.144.94.245", "201.217.41.78", + "201.217.49.194", "201.222.48.206", "201.222.50.30", "201.222.52.126", @@ -381,12 +423,9 @@ "202.29.5.151", "202.39.210.77", "202.43.162.242", - "202.43.162.37", - "202.44.53.251", "202.46.34.74", "202.51.111.149", "202.56.128.30", - "202.58.198.158", "202.62.224.2", "202.64.161.118", "202.83.121.10", @@ -411,15 +450,12 @@ "203.85.45.24", "203.85.45.26", "204.13.152.3", - "204.193.157.30", "204.194.232.200", "204.194.234.200", "204.50.158.125", "205.171.202.166", - "205.171.202.25", "205.171.3.66", "205.214.45.10", - "205.242.187.234", "206.165.6.12", "206.74.254.2", "207.188.83.213", @@ -430,6 +466,8 @@ "207.68.32.39", "207.69.188.185", "208.38.65.35", + "208.67.220.123", + "208.67.220.220", "208.67.222.220", "208.91.112.220", "208.91.112.52", @@ -437,7 +475,6 @@ "209.105.243.218", "209.130.139.2", "209.191.129.65", - "209.209.217.168", "209.216.160.131", "209.216.160.2", "209.239.11.98", @@ -446,6 +483,7 @@ "209.252.188.104", "209.253.113.10", "209.51.161.14", + "209.58.147.36", "210.0.128.241", "210.0.128.242", "210.0.128.251", @@ -469,7 +507,7 @@ "211.105.7.5", "211.115.194.2", "211.188.11.201", - "211.221.79.4", + "211.34.105.59", "211.63.64.11", "211.72.106.204", "211.72.210.250", @@ -490,16 +528,20 @@ "212.36.64.17", "212.43.98.12", "212.46.234.217", + "212.47.228.136", "212.58.212.83", "212.66.129.98", + "212.78.94.40", "212.85.112.32", "212.89.130.180", + "212.94.34.34", "213.115.226.2", "213.136.192.2", "213.184.224.254", + "213.196.191.96", + "213.202.216.12", + "213.202.216.236", "213.211.50.1", - "213.24.238.26", - "213.241.88.98", "213.244.72.31", "213.30.88.178", "213.5.120.2", @@ -507,13 +549,15 @@ "213.55.96.148", "213.55.96.166", "216.104.206.136", - "216.106.1.254", "216.106.1.3", "216.106.88.3", + "216.119.155.49", "216.136.95.2", "216.146.35.35", + "216.169.160.23", "216.169.187.240", "216.173.178.83", + "216.183.210.18", "216.185.64.6", "216.187.93.250", "216.199.54.9", @@ -521,17 +565,19 @@ "216.21.129.22", "216.237.114.148", "216.237.114.149", - "216.240.32.140", "216.240.32.71", "216.240.32.72", "216.240.32.74", "216.66.104.72", "217.112.27.34", "217.12.181.97", + "217.138.219.219", + "217.138.220.243", "217.14.128.50", "217.18.206.22", "217.19.153.3", "217.195.211.116", + "217.219.132.88", "217.219.250.200", "217.219.250.202", "217.219.72.194", @@ -546,7 +592,6 @@ "220.130.145.66", "220.130.192.226", "220.241.92.140", - "221.143.46.198", "221.154.98.205", "221.163.74.11", "221.186.117.10", @@ -555,6 +600,10 @@ "223.197.203.142", "223.197.220.13", "223.6.6.6", + "23.19.245.84", + "23.19.245.88", + "23.226.134.242", + "23.226.134.243", "24.113.32.29", "24.113.32.30", "24.181.107.226", @@ -564,12 +613,19 @@ "24.229.250.113", "24.96.80.122", "27.123.22.82", - "31.129.186.43", "31.24.200.4", "31.24.234.37", "31.47.196.210", "31.47.196.211", "37.111.49.182", + "37.120.142.115", + "37.120.152.235", + "37.120.193.219", + "37.120.207.131", + "37.120.211.91", + "37.120.232.43", + "37.120.235.187", + "37.120.236.11", "37.235.1.174", "37.235.1.177", "37.235.70.59", @@ -578,14 +634,17 @@ "4.2.2.3", "4.2.2.6", "41.58.181.74", + "41.79.69.13", "42.116.255.180", "43.224.122.28", "43.227.12.72", "43.229.62.192", - "43.245.180.22", "45.133.105.123", + "45.142.176.170", + "45.153.187.96", "45.173.200.10", "45.33.97.5", + "45.63.110.187", "45.67.219.208", "45.90.28.0", "45.90.28.165", @@ -594,12 +653,17 @@ "45.90.28.226", "45.90.30.126", "45.90.30.169", + "45.91.92.121", "46.10.205.252", "46.173.34.32", + "46.182.19.48", "46.20.67.50", "46.224.1.43", + "46.227.200.54", "46.231.210.26", "49.0.184.30", + "5.1.66.255", + "5.102.56.177", "5.145.112.38", "5.145.112.39", "5.196.123.133", @@ -608,14 +672,29 @@ "5.83.92.254", "5.9.172.92", "50.194.130.97", + "50.204.174.58", + "50.220.226.155", + "50.239.7.17", + "50.241.117.197", + "50.247.100.49", + "50.76.49.81", + "51.15.122.250", + "51.15.124.208", + "51.158.166.97", + "51.195.117.26", + "51.195.200.182", "51.254.25.115", + "51.38.83.141", + "51.79.158.183", "51.89.88.77", "52.3.100.184", + "52.65.235.129", "59.124.195.5", "59.124.69.205", "59.124.72.210", "59.125.182.149", "59.148.213.230", + "59.148.249.214", "59.148.250.34", "59.188.74.1", "60.244.115.166", @@ -634,7 +713,6 @@ "62.77.202.25", "62.82.213.91", "62.86.183.222", - "62.91.19.67", "62.94.0.42", "62.97.123.106", "62.97.123.107", @@ -643,17 +721,20 @@ "63.171.232.38", "63.246.63.142", "64.128.251.228", + "64.212.106.84", "64.212.106.85", "64.233.217.2", "64.238.96.12", "64.80.255.251", "64.94.1.33", - "65.111.169.159", "65.111.169.164", + "65.246.64.210", + "65.246.64.217", "65.48.229.96", "66.109.229.6", "66.18.240.197", "66.181.167.232", + "66.199.45.225", "66.232.139.10", "66.242.160.6", "66.28.0.45", @@ -669,6 +750,7 @@ "68.87.76.178", "68.87.76.182", "69.1.1.251", + "69.160.0.186", "69.160.4.206", "69.169.190.211", "69.24.197.9", @@ -677,32 +759,50 @@ "69.63.73.141", "69.67.97.18", "69.7.192.2", + "70.36.170.126", "70.88.112.101", "70.90.140.130", + "71.246.241.149", + "71.69.166.70", + "72.11.134.90", + "72.11.134.91", + "72.134.185.203", "72.51.45.191", + "73.111.101.34", + "73.77.45.195", + "74.118.141.47", "74.120.24.97", + "74.93.217.204", "74.93.247.57", "75.148.63.125", + "76.190.56.126", "76.72.248.34", "76.76.2.0", "76.76.2.1", "76.76.2.2", "76.76.2.3", + "76.81.95.43", + "76.82.118.158", "77.42.130.37", "77.88.8.1", "77.88.8.2", "77.88.8.3", "77.88.8.7", + "77.88.8.78", "77.88.8.88", + "78.129.140.65", "78.130.39.189", "78.156.159.132", "78.159.43.189", "78.38.117.206", + "78.46.244.143", "78.47.243.3", + "78.47.64.161", "79.187.201.179", "79.187.201.181", "79.190.224.27", "8.0.7.0", + "8.20.247.2", "8.20.247.20", "8.8.8.8", "80.179.155.145", @@ -712,7 +812,6 @@ "80.66.120.34", "80.67.169.40", "80.78.132.79", - "80.83.162.11", "81.1.217.134", "81.138.71.238", "81.163.3.1", @@ -723,6 +822,7 @@ "82.141.136.2", "82.141.171.84", "82.146.26.2", + "82.221.128.44", "82.70.88.14", "82.96.65.2", "82.99.242.155", @@ -733,9 +833,13 @@ "83.246.140.204", "84.124.52.46", "84.16.240.43", + "84.200.70.40", "84.236.142.130", + "84.237.112.130", "84.52.103.114", + "84.8.2.11", "84.96.26.129", + "85.114.138.119", "85.132.85.85", "85.18.246.73", "85.18.52.172", @@ -743,6 +847,7 @@ "85.255.157.162", "85.93.217.105", "86.102.30.109", + "86.106.74.219", "86.107.249.193", "86.58.179.6", "87.117.196.200", @@ -754,8 +859,8 @@ "88.151.140.202", "88.208.211.65", "88.80.64.8", - "89.106.109.235", "89.113.0.68", + "89.163.221.181", "89.17.194.43", "89.211.53.228", "89.221.2.168", @@ -765,6 +870,8 @@ "89.236.217.93", "89.29.128.250", "9.9.9.10", + "9.9.9.11", + "9.9.9.12", "9.9.9.9", "90.183.151.106", "90.183.151.107", @@ -780,8 +887,10 @@ "91.203.177.216", "91.205.3.65", "91.208.193.1", + "91.219.215.227", "91.229.232.57", "91.229.232.81", + "91.230.211.67", "91.239.100.100", "91.239.207.90", "92.223.65.71", @@ -791,16 +900,33 @@ "93.63.229.132", "93.91.140.127", "93.91.145.230", + "93.95.226.165", + "94.140.14.14", "94.140.14.140", + "94.140.14.15", "94.140.15.15", "94.158.96.2", "94.176.233.93", + "94.198.41.235", "94.236.218.254", + "94.237.75.42", + "94.242.59.35", "94.247.43.254", "95.142.83.43", "95.158.129.2", + "95.216.212.177", "95.217.229.211", - "98.101.120.225" + "96.255.15.47", + "96.87.252.245", + "98.101.121.118", + "98.121.16.164", + "98.152.56.27", + "98.208.56.152", + "98.212.26.37", + "98.213.194.66", + "98.244.8.17", + "98.255.2.112", + "98.38.222.125" ], "matching_attributes": [ "ip-src", @@ -809,5 +935,5 @@ ], "name": "List of known IPv4 public DNS resolvers", "type": "cidr", - "version": 20210830 + "version": 20210915 } diff --git a/lists/public-dns-v6/list.json b/lists/public-dns-v6/list.json index a1eaa55..e840e37 100644 --- a/lists/public-dns-v6/list.json +++ b/lists/public-dns-v6/list.json @@ -3,6 +3,9 @@ "list": [ "2001:148f:fffe::1", "2001:1608:10:25::9249:d69b", + "2001:19f0:5001:cbb:5400:3ff:fe07:f70d", + "2001:19f0:5c01:147e:5400:3ff:fe2a:3b1f", + "2001:19f0:7402:1574:5400:2ff:fe66:2cff", "2001:418:3ff::1:53", "2001:418:8006::12", "2001:468:c80:2101:0:100:0:22", @@ -11,13 +14,28 @@ "2001:470:2351:11::1", "2001:470:2351::1", "2001:4860:4860::8844", + "2001:678:e68:f000::", "2001:67c:28a4::", "2001:840:100::", "2001:910:800::12", + "2001:910:800::40", "2001:978:1:1::d", + "2001:bc8:1820:50d::1", + "2001:bc8:1824:738::1", + "2001:bc8:1830:2018::1", + "2001:bc8:47b0:1a01::1", + "2400:6180:0:d0::5f6e:4001", + "2400:8901::f03c:92ff:fe27:870a", + "2400:8902::f03c:91ff:feda:c514", + "2400:8902::f03c:92ff:fe27:344b", + "2400:8907::f03c:92ff:fe63:e748", + "2402:1f00:8000:800::12ba", + "2607:5300:201:3100::3dfb", "2607:5300:203:1797::53", "2607:5300:203:7f27:5054:ff:fe45:85b5", "2607:5300:203:7f27:5054:ff:fe57:4a07", + "2607:f130:0:f8::3085:e961", + "2607:fdc0:2:0:f816:3eff:fe32:c7b4", "2610:a1:1019::1", "2620:0:ccc::2", "2620:0:ccd::2", @@ -27,12 +45,18 @@ "2620:74:1c::2:2", "2620:fe::10", "2a00:1508:0:4::9", + "2a00:d880:3:1::a6c1:2e89", "2a00:f826:8:1::254", "2a00:f826:8:2::195", "2a00:fbe0:1:3802::3", "2a01:3a0:53:53::", + "2a01:4f8:151:11b0::3", "2a01:4f8:151:34aa::198", + "2a01:4f8:1c17:4df8::1", "2a01:4f8:c17:739a::2", + "2a01:4f8:c17:ec67::1", + "2a01:4f9:c010:43ce::1", + "2a01:9e00::54", "2a02:6b8:0:1::feed:a11", "2a02:6b8:0:1::feed:bad", "2a02:6b8::feed:bad", @@ -40,10 +64,19 @@ "2a03:4000:24:688::6e73:31", "2a03:4000:4d:c92:88c0:96ff:fec6:b9d", "2a03:4000:6:e5fc::1", + "2a03:b0c0:1:e0::487:1001", + "2a04:3543:1000:2310:4831:c1ff:feb5:30a4", + "2a04:3544:8000:1000:4831:c1ff:feb5:64b2", "2a04:52c0:101:75::75", "2a0c:8fc0:c3e5::1000", + "2a0d:2a00:1::", + "2a0d:2a00:1::1", "2a0d:5600:33:3::3", - "2a10:50c0::1:ff" + "2a0e:dc0:6:23::2", + "2a10:50c0::1:ff", + "2a10:50c0::ad1:ff", + "2a10:50c0::bad1:ff", + "2c0f:fda8:5::2ed1:d2ec" ], "matching_attributes": [ "ip-src", @@ -52,5 +85,5 @@ ], "name": "List of known IPv6 public DNS resolvers", "type": "cidr", - "version": 20210830 + "version": 20210915 } diff --git a/tools/generate-publicdns.py b/tools/generate-publicdns.py index 8b33593..11f13ac 100755 --- a/tools/generate-publicdns.py +++ b/tools/generate-publicdns.py @@ -1,17 +1,16 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- import csv import ipaddress import logging +from typing import List, Tuple from generator import download_to_file, get_version, write_to_file, get_abspath_source_file golden_servers_ipv4 = ['9.9.9.9', '8.8.8.8'] -def process(file): - lipv4, lipv6, lhostname = get_lists(file) +def process(ipv4: List, ipv6: List, hostname: List): # Public DNS Domains publicdns_hostname_dst = 'public-dns-hostname' publicdns_hostname_warninglist = { @@ -20,7 +19,7 @@ def process(file): 'type': 'hostname', 'matching_attributes': ['hostname', 'domain', 'url', 'domain|ip'] } - generate(lhostname, publicdns_hostname_warninglist, publicdns_hostname_dst) + generate(hostname, publicdns_hostname_warninglist, publicdns_hostname_dst) # Public DNS IPv4 publicdns_ipv4_dst = 'public-dns-v4' @@ -30,7 +29,7 @@ def process(file): 'type': 'cidr', 'matching_attributes': ['ip-src', 'ip-dst', 'domain|ip'] } - generate(lipv4, publicdns_ipv4_warninglist, publicdns_ipv4_dst) + generate(ipv4, publicdns_ipv4_warninglist, publicdns_ipv4_dst) # Public DNS IPv4 publicdns_ipv6_dst = 'public-dns-v6' @@ -40,19 +39,17 @@ def process(file): 'type': 'cidr', 'matching_attributes': ['ip-src', 'ip-dst', 'domain|ip'] } - generate(lipv6, publicdns_ipv6_warninglist, publicdns_ipv6_dst) + generate(ipv6, publicdns_ipv6_warninglist, publicdns_ipv6_dst) def generate(data_list, warninglist, dst): - warninglist['version'] = get_version() warninglist['list'] = data_list write_to_file(warninglist, dst) -def get_lists(file): - +def get_lists_publidns(file) -> Tuple[List, List, List]: with open(get_abspath_source_file(file)) as csv_file: servers_list = csv.reader(csv_file, delimiter=',', quotechar='"') @@ -81,10 +78,44 @@ def get_lists(file): return lipv4, lipv6, lhostname -if __name__ == '__main__': +def get_lists_dnscrypt(file) -> Tuple[List, List]: + with open(get_abspath_source_file(file)) as csv_file: + servers_list = csv.reader(csv_file, delimiter=',', quotechar='"') + next(servers_list) # skip header + lipv4 = [] + lipv6 = [] + for row in servers_list: + address = row[10] + if address[0] == "[": + address = address[1:address.index("]")] + else: + address = address.split(":")[0] + ip = ipaddress.ip_address(address) + if ip.version == 4: + lipv4.append(ip.compressed) + elif ip.version == 6: + lipv6.append(ip.compressed) + + return lipv4, lipv6 + + +def main(): publicdns_url = 'https://public-dns.info/nameservers.csv' publicdns_file = 'public-dns-nameservers.csv' - download_to_file(publicdns_url, publicdns_file) - process(publicdns_file) + dnscrypt_url = "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v1/dnscrypt-resolvers.csv" + dnscrypt_file = "dnscrypt-resolvers.csv" + download_to_file(dnscrypt_url, dnscrypt_file) + + ipv4, ipv6, hostname = get_lists_publidns(publicdns_file) + ipv4_c, ipv6_c = get_lists_dnscrypt(dnscrypt_file) + + ipv4 += ipv4_c + ipv6 += ipv6_c + + process(ipv4, ipv6, hostname) + + +if __name__ == '__main__': + main()