Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 889 Bytes

api.rst

File metadata and controls

31 lines (23 loc) · 889 Bytes

tdns API

The :py:class:`Channel <tdns.Channel>` implements a Python class for interacting with the c-ares API using native Tornado asynchronous conventions. For example, to query the MX records for google you could use the following snippet:

from tornado import gen, ioloop, web
import tdns


class RequestHandler(web.RequestHandler):

    @gen.coroutine
    def get(self, *args, **kwargs):
        channel = tdns.Channel(io_loop=ioloop.IOLoop.current())
        response = yield channel.query('google.com', 'MX')

tnds is build on top of the excellent pycares library.

Ares Channel

.. autoclass:: tdns.Channel
    :members:
    :inherited-members:

Utility Functions

.. autofunction:: tdns.reverse_address