Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Asynchronous DNS-over-HTTPS client for Python

Project Description

aio-doh

Is a tiny asynchronous client for Google’s Public DNS-over-HTTPS service. It is built on top of asyncio and aiohttp

Installation

pip install aio-doh

Example usage

>>> from doh import DOHClient
>>> from asyncio import get_event_loop
>>>
>>> loop = get_event_loop()
>>> client = DOHClient(loop)
>>> loop.run_until_complete(client.resolve('example.com'))
['93.184.216.34']
>>>

API

The API is simple and small

DOHClient.query(hostname, type, dnssec)
hostname - name of a target host; type - DNS record type for a query; dnssec - enable DNSSEC validation. Returns a complete DNS response as a python dictionary.
DOHClient.resolve(hostname, type, dnssec)
hostname - name of a target host; type - DNS record type for a query; dnssec - enable DNSSEC validation. Returns a list of IP adresses.
DOHClient.gethostbyname(hostname, type, dnssec)
hostname - name of a target host; type - DNS record type for a query; dnssec - enable DNSSEC validation. Returns the first IP adress found if any or raises an error.

Documentation

TODO

Contributing

File and issue or create a pull request.

Release History

Release History

This version
History Node

0.0.4

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
aio_doh-0.0.4-py3.6.egg (7.2 kB) Copy SHA256 Checksum SHA256 3.6 Egg Dec 16, 2017
aio-doh-0.0.4.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source Dec 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting