Module dns

Source
Expand description

Implement a simple DNS resolver that relay request over Tor.

A resolver is launched with run_dns_resolver(), which listens for new connections and then runs

Structsยง

DnsCacheKey ๐Ÿ”’
Identifier for a DNS request, composed of its source IP and transaction ID
DnsIsolationKey ๐Ÿ”’
A Key used to isolate dns requests.
DnsResponseTarget ๐Ÿ”’
Target for a DNS response

Constantsยง

MAX_DATAGRAM_SIZE ๐Ÿ”’
Maximum length for receiving a single datagram

Functionsยง

do_query ๐Ÿ”’
Run a DNS query over tor, returning either a list of answers, or a DNS error code.
handle_dns_req ๐Ÿ”’
Given a datagram containing a DNS query, resolve the query over the Tor network and send the response back.
run_dns_resolver
Launch a DNS resolver to listen on a given local port, and run indefinitely.