vshymanskyy / aiodns

A small async DNS client for MicroPython
MIT License
9 stars 1 forks source link
asyncio cellular esp32 esp8266 ethernet lte micropython rpi-pico-w wifi

aiodns

StandWithUkraine GitHub issues GitHub license Support vshymanskyy

A small async DNS client for MicroPython

Install

Install using ViperIDE

Using CLI:

mpremote mip install github:vshymanskyy/aiodns

Using REPL (your board must be connected to the internet):

import mip
mip.install("github:vshymanskyy/aiodns")

Example

See usage examples

API

aiodns.servers = set(["8.8.8.8", "1.1.1.1"])
aiodns.servers.add("9.9.9.9")
aiodns.timeout_ms = 5000
aiodns.cache.clear()
aiodns.cache_size = 32
await aiodns.getaddrinfo(hostname, port, family=AF_INET, type=0, proto=0, flags=0)