Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@gera2ld gera2ld released this 22 Jul 13:32
· 2 commits to master since this release

Features

  • Added a dedicated DNS client for raw requests (#25):
import asyncio
from async_dns.core import types, Address
from async_dns.resolver import DNSClient

async def query():
    client = DNSClient()
    res = await client.query('www.google.com', types.A,
                             Address.parse('8.8.8.8'))
    print(res)
    print(res.aa)

asyncio.run(query())

Breaking Changes

  • resolver.query now returns two items:

    message, from_cache = await resolver.query(hostname, types.A)

    message is the result of the DNS look up and has a type of DNSMessage. from_cache is a boolean representing whether the result is read from the resolver cache.

  • resolver.query no longer eats exceptions so the caller should take care of them.