| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- """
- This file is part of the UFONet project, https://ufonet.03c8.net
- Copyright (c) 2013/2026 | psy <epsylon@riseup.net>
- You should have received a copy of the GNU General Public License along
- with UFONet; if not, write to the Free Software Foundation, Inc., 51
- Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- """
- import random
- PUBLIC_DNS_RESOLVERS = [
- "8.8.8.8", "8.8.4.4",
- "1.1.1.1", "1.0.0.1",
- "1.1.1.2", "1.0.0.2",
- "1.1.1.3", "1.0.0.3",
- "208.67.222.222", "208.67.220.220",
- "208.67.222.123", "208.67.220.123",
- "9.9.9.9", "149.112.112.112",
- "9.9.9.10", "149.112.112.10",
- "94.140.14.14", "94.140.15.15",
- "94.140.14.15", "94.140.15.16",
- "94.140.14.140", "94.140.14.141",
- "185.228.168.9", "185.228.169.9",
- "185.228.168.168", "185.228.169.168",
- "185.228.168.10", "185.228.169.11",
- "77.88.8.8", "77.88.8.1",
- "77.88.8.88", "77.88.8.2",
- "77.88.8.7", "77.88.8.3",
- "84.200.69.80", "84.200.70.40",
- "8.26.56.26", "8.20.247.20",
- "64.6.64.6", "64.6.65.6",
- "76.76.2.0", "76.76.10.0",
- "76.76.2.1", "76.76.10.1",
- "76.76.2.2", "76.76.10.2",
- "76.76.2.3", "76.76.10.3",
- "76.76.2.4", "76.76.10.4",
- "45.90.28.0", "45.90.30.0",
- "194.242.2.2", "194.242.2.3",
- "194.242.2.4", "194.242.2.5",
- "193.110.81.0", "185.253.5.0",
- "193.110.81.9", "185.253.5.9",
- "193.110.81.1", "185.253.5.1",
- "74.82.42.42",
- "158.64.1.29",
- "78.47.64.161",
- "89.233.43.71", "91.239.100.100",
- "116.203.225.86",
- "146.255.56.98",
- "159.69.198.101",
- "108.61.201.119",
- "95.216.211.211",
- "216.146.35.35", "216.146.36.36",
- "51.158.108.203",
- "95.216.165.235",
- ]
- OPENDNS_RESOLVERS = [
- "208.67.222.222", "208.67.220.220",
- "208.67.222.123", "208.67.220.123",
- ]
- DUMMY_ROUTABLE_HOSTS = [
- "8.8.8.8", "1.1.1.1", "9.9.9.9", "208.67.222.222",
- "8.8.4.4", "1.0.0.1", "149.112.112.112",
- ]
- def random_resolvers(n=2):
- n = max(1, min(n, len(PUBLIC_DNS_RESOLVERS)))
- return random.sample(PUBLIC_DNS_RESOLVERS, n)
- def random_opendns():
- return random.sample(OPENDNS_RESOLVERS, min(2, len(OPENDNS_RESOLVERS)))
- def random_dummy_host():
- return random.choice(DUMMY_ROUTABLE_HOSTS)
|