Package: publicdns
.. class:: center=========PublicDNS=========PublicDNS is a high-perfmrnace, secure, reliable python DNS client `over HTTP/2 and TLS`__.__ https://developers.google.com/speed/public-dns/docs/dns-over-httpsAs written in Google DNS-over-HTTPS guide, this offers a variety of features as follows:- support all RRs- support DNSSEC validation- support for IPv4 and IPv6- can insure against `privacy concerns`____ https://https.cio.gov/everything/Performance===========While tranditional DNS client does not support `put multiple questions into a single call`__,PublicDNS has advantage that it's much faster when dealing with multiple questions, `a big advantage of HTTP/2`__.Because Google servers also run over QUIC, this also means that performance will be much better if it is implemented.I recently benchmarked with a small amount of domains, take a look at the result:.. code-block:: console- dns.resolver100%|███| 100/100 [00:32<00:00, 3.97s/it]dns.resolver * 100 - took 32.5060371872969s- PublicDNS100%|███| 100/100 [00:13<00:00, 12.8it/s]PublicDNS * 100 - took 13.507565873209387s__ https://groups.google.com/d/msg/comp.protocols.dns.bind/uOWxNkm7AVg/wKtsmudkY1UJ__ https://istlsfastyet.com/#faqInstallation============Install PublicDNS using easy_setup or pip:.. code-block:: consolepip install publicdnsExample=======.. code-block:: pythonfrom publicdns.client import PublicDNSclient = PublicDNS()result = client.query('www.google.com', 'A')ip = client.resolve('www.google.com')To see more usage, just dive into the ``tests`` directory.API===The public API is really simple, totaling only 2 API calls:* ``query(host, type='A', dnssec=True)``: Do a DNS resolution of the given type for the given hostname. It returns aninstance of ``publicdns.models.DNSResponse``.* ``resolve(host, type='A', dnssec=True)``: Do a DNS resolution of the given type for the given hostname. While``query()`` returns an instance of ``publicdns.models.DNSResponse``, ``resolve()`` only return a list of datalike ``['8.8.8.8']``.Patching--------Replace some functions of the standard socket object with publicdns's implementation... code-block:: pythonfrom publicdns.monkey import patch_socketpatch_socket()Documentation=============Until the project is properly documented you will have to rely on the source code. It is rather undocumented now, butbetter documentation is under way. On the other hand, the code is quite extensively tested.Query Limitation----------------Google can limit the number of API requests. Please follow `Rate-limiting queries`__ section.__ https://developers.google.com/speed/public-dns/docs/security#rate_limitRunning tests=============PublicDNS has tests. These tests ensure that the code is in a working state. You have to install some external packages to run tests, listed in ``test_requirements.txt``:.. code-block:: console$ pip install -r test_requirements.txtthen:.. code-block:: console$ py.testAlternatively, to run them in every supported Python version do:.. code-block:: console$ toxContributing===========1. Create an issue and describe your idea2. Fork this repo3. Create your feature branch (``git checkout -b my-new-feature``)4. Run tests5. Add a test for your feature6. Run step 4 again7. Commit your changes (``git commit -am 'Add some feature'``)8. Publish the branch (``git push origin my-new-feature``)9. Create a new Pull RequestLicense=======PublicDNS is released under the `MIT License`__.__ http://www.opensource.org/licenses/MIT