Home > other >  Using the Python client terminal in the network analytical DNS (edns) options
Using the Python client terminal in the network analytical DNS (edns) options

Time:09-27

I am looking for a Python implementation, allow me to use the DNS (EDNS) the expansion of the "customer terminal options" to resolve the DNS address. This option allows better DNS content delivery system - and ultimately, faster Internet routing. The motivation to better explain here: http://www.afasterinternet.com/howitworks.htm
Another name is "vandergaast - edns - the client - subnet configures"
There is a mining: https://www.gsic.uva.es/~jnisigl/dig-edns-client-subnet.html
I am looking for a can do the same python implementation.

CodePudding user response:

I am dnspython clientsubnet developers/maintainers. It is designed to in your code as additives for dnspython. I just released 2.0.0 version (after trying to do what you want to do), that makes everything easier
PIP install clientsubnetoption (applicable to Python2 and Python3) & gt; You need import the client choice and dependence:

The import DNS
The import clientsubnetoption

Use the information you want set ClientSubnetOption:

Cso=clientsubnetoption. Clientsubnetoption (' 2 ')

Create your DNS packets:

Message=DNS. Message. Make_query (' google.com ', 'A')

Add edns options:

Message. Use_edns (options=(cso))

The query using the message:

R=the DNS query. Udp (message, '8.8.8.8)

Option information now in r.o ptions and may have more than one, so you may need to traverse them to find the ClientSubnetOption object.

For the options in r.o ptions:
If isinstance (options, ClientSubnetOption) :
# do stuff here
Pass

Clientsubnetoption. Py the code used for unit testing and support edns - clientsubnet testing tools, not because you have to use it in this way.

CodePudding user response:

I use this library test tencent public DNS 119.29.29.29 cannot resolve, test 8.8.8.8 can use, is this why
  • Related