Metadata-Version: 2.5
Name: namespy
Version: 0.1.0
Summary: Asyncio DNS library: iterative resolver, wire codec, and inspection CLI
Project-URL: Homepage, https://github.com/b1tninja/namespy
Project-URL: Repository, https://github.com/b1tninja/namespy
Project-URL: Issues, https://github.com/b1tninja/namespy/issues
Project-URL: Changelog, https://github.com/b1tninja/namespy/blob/master/CHANGELOG.md
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: asyncio,dns,packet-parsing,recursive,resolver,wire-format
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.12
Provides-Extra: crypto
Requires-Dist: cryptography>=50.0.2; extra == 'crypto'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hypothesis; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: doh
Requires-Dist: h2>=4.1; extra == 'doh'
Description-Content-Type: text/markdown

# namespy

[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
![CI](https://github.com/b1tninja/namespy/actions/workflows/ci.yml/badge.svg)
![Security](https://github.com/b1tninja/namespy/actions/workflows/security.yml/badge.svg)
<!-- PyPI badges go live with the first release; publishing is wired and the
     name is registered to this repo's trusted publisher at that moment. Until
     then a shields.io pypi badge would render "no version" on the landing page.
     Uncomment at the tag:
[![PyPI - Version](https://img.shields.io/pypi/v/namespy.svg)](https://pypi.org/project/namespy/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/namespy.svg)](https://pypi.org/project/namespy/)
-->

An asyncio DNS library: a wire codec that survives malformed input, an iterative
resolver that follows RFC 1034 section 5.3.3 literally, and a `dig`-flavoured
inspector. No runtime dependencies — one optional extra, `namespy[crypto]`, for the
signature arithmetic DNSSEC validation runs on.

- **Python:** 3.12+ · **one name everywhere:** `pip install namespy`,
  `import namespy`, `namespy example.com`
- **Naming:** it used to be `aiodns` on import and `dnspy` on the command line.
  Both collided with unrelated projects — [`aiodns`](https://pypi.org/project/aiodns/)
  is an established asyncio resolver, and `dnspy` is an FQDN-manipulation library
  — so installing this would have shadowed one of them. One string now covers the
  distribution, the import and the console script, which is the only arrangement
  that cannot surprise anyone.
- **Status:** the codec, resolver and CLI are tested and usable, EDNS(0)
  included, with DNSSEC validation opt-in (`--validate`, RFC 4035 §4.3) — see
  [What it does not do](#what-it-does-not-do)
- **Spec anchors:** [`docs/roadmap.md`](docs/roadmap.md) is the completeness
  matrix — every protocol obligation this code could take on, with an honest
  status and the test that pins it, and the roadmap the gaps consolidate
  into. [`docs/rfc-map.md`](docs/rfc-map.md) is the deep RFC 1034 §5.3.3
  walkthrough behind the resolver. [`docs/strategy.md`](docs/strategy.md) is
  why the next rows are ordered the way they are — the layering rule (core =
  RFC implementation, `namespy.apps.*` composes it, examples configure it) and
  the positioning the October 2026 landscape survey settled on

## Install

```bash
python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\Activate.ps1
pip install -e ".[dev]"
```

Not published to PyPI yet, so install from the repository.

`pip install -e ".[crypto]"` adds `cryptography`, and only that. It is an extra rather than a
requirement because the resolver works without it — it answers unauthenticated, which is a
different failure from not answering — and because `import namespy` must stay dependency-free
whether or not the extra is present. `namespy.crypto.crypto_available()` reports which
install you are in; nothing else in the tree is allowed to ask.

## Try it

```bash
namespy example.com                  # dig-style answer
namespy example.com AAAA
namespy example.com A --mqtype AAAA --mqtype HTTPS   # one walk, three types (RFC 10029)
namespy --short example.com MX       # or: namespy +short example.com MX
namespy example.com --trace          # print the steps; write the diagram to last_resolution.md
namespy --serve                      # demo server on 127.0.0.1:53
```

`python -m namespy` does the same without installing the console script, and
`namespy --help` lists the rest (`--no-edns`, `--nsid`, `--mqtype`, `--root-hints`,
`--dns-suffix`, `--timeout`, `--trace-file`, `--qname-min`,
`--allow-out-of-bailiwick-glue`, `--ignore-special-names`, `--no-failure-cache`,
`-v`, `--debug`).

Special-use names are answered from the registry, never from the network
(`namespy/special.py`): `.invalid` is NXDOMAIN on sight (RFC 6761 §6.4),
`localhost` names answer the loopback address for A/AAAA and nothing for
every other type (§6.3), `.test` and the RFC 1918 reverse zones answer
negative by default (§6.2, §6.1), `.local` stays on its link (RFC 6762 §3),
and `.onion` is refused per RFC 7686 §2. `--ignore-special-names` enables
the configuration option §6.2¶4 itself tells resolvers to offer — for a
private network that really does serve those names; it warns, because the
same flag releases `.onion` queries, which leak the question before they
waste it.

The blocklist client reads lists the way their operators mean them
(`namespy/rbl.py`): `namespy --rbl 203.0.113.7 zen.example` (or
`namespy rbl ADDRESS ZONE`) builds the reversed address — octets per
RFC 1035 §3.5, nibbles per RFC 3596 §2.5 — and asks the **zone's own
authorities** (a walk ends there; only their 127.0.0.x was ever
claimed), decodes the listing codes, fetches the TXT explanation, and
caps the answer's cache life at an hour. Listed, not-listed and unknown
stay three answers — exit codes 0/1/2 say so to scripts, and a zone that
declined to answer is never read as innocent. `namespy --ptr 203.0.113.7`
asks the same reversed name under `in-addr.arpa`: one reversal, both
trees. `examples/blocklist.py` serves a fake list zone and checks it
live, both verdicts and all.

`--trace` prints the walk live — one numbered line per step on stderr, as the
walk takes it — queries show the zone
asked (`-> .: example.com A (probe)`), replies and notes read downward in the
order they happened — and writes the same steps as a Mermaid `sequenceDiagram`
to `--trace-file`, so GitHub renders it directly; the diagram is where to look
for exactly where a zone cut was crossed and which NS forced a glueless
sub-resolution, and the terminal lines are where to look while it happens.

`--serve` binds loopback on purpose. It is a codec exercise, not a name server;
but it does answer for names you give it: `--serve-reflexive` binds the
reflexive zone (`namespy --forward 127.0.0.1 whoami TXT` answers the address,
port, and transport your query arrived on — an answer only the socket can
give), and `DnsServer.bind(name, handler)` is the same door for anything a
callable can compute — see `examples/dynamic_responders.py`, which runs the
reflex, a lambda die, a clock, and a suffix-bound mirror on one port. TLS
closes both remaining doors: `--serve --serve-dot --dot-cert FILE --dot-key
FILE` answers RFC 7858's port 853 (settable with `--dot-port`) through the
same pipeline — a `whoami` query that crossed TLS answers "over dot", because
the reflex refuses to lie about the socket — and `--forward-dot ADDRESS#NAME`
sends the server's own queries to encrypted upstreams instead of walking from
the root: bound names answer first, one connection is reused per upstream
(RFC 7858 §3.4), an upstream that refuses TLS is remembered for an hour
(§3.1¶4), and universal silence explains itself with RFC 8914's "no reachable
authority". Policy answers too: `--serve --filter ACTION:NAME` (repeatable,
first rule wins) refuses a name as block or censor (NXDOMAIN), filter
(NODATA), or prohibit (REFUSED), each explained on the wire by its RFC 8914
extended error code 15–18 — judged after bound names and before the cache,
any forwarder, and the walk, and never carrying AA, AD, or a cache entry.
And `--serve --zone FILE` (repeatable) makes it authoritative for a real
zone file — RFC 1035 §5.1 presentation format in, RFC 1034 §4.3.2 answers
out: AA on whatever the zone's own data produced, genuine referrals below
an in-zone cut (the child's NS in authority, in-bailiwick glue in
additional, AA off — the answer belongs to the servers being named), and
synthesized wildcards wearing the query's own name. `$ORIGIN`, `$TTL`,
`$INCLUDE`, and RFC 3597's `\#` generic RDATA load; `$GENERATE` is refused
by name. A zone is consulted after bound names and before the filter: a
bind overrides even your own zone, and the filter guards what the server
asks for others, never what it authors. And
`--serve --serve-query-log FILE` appends one JSON-lines record per
answer — client, transport, the rung it came off (`bind`, `zone`,
`policy`, `forward`, `recurse`, `reject`), the RCODE and any EDE codes,
sizes, elapsed milliseconds — default off, like everything this server
writes to someone's disk.
exposing a recursive resolver to a network you do not control turns it into an
amplification instrument (RFC 5358, RFC 9085). See [`SECURITY.md`](SECURITY.md).

Root hints ship inside the package and load through `importlib.resources`, so a
fresh checkout resolves from the root servers with no setup and no network access
at construction time. `await resolver.refresh_root_hints()` fetches a current
copy from [Internic](https://www.internic.net/domain/named.root) if you want one;
nothing else in the library contacts that URL.

## Use it as a library

For the common case there is a one-call facade over the whole endpoint dance —
records back, and a line saying *how it knows*:

```python
from namespy.apps import lookup

result = lookup("example.com", "A")  # blocking; walks the tree, or forward with via="1.1.1.1"
for record in result.records:
    print(record.name, record.ttl, record.rdata)
print(result.line)  # e.g. "walk validated", "walk cache unsigned", "forward stale"

result = lookup("db.internal", "A", hosts="/etc/hosts")  # consults hosts before DNS
print(result.line)  # "hosts line 12 of /etc/hosts unsigned" -- an override that says so
```

It runs on `namespy.engine`'s thread, so it is legal even from inside a loop you
are already running. For a client you hold across many questions — where a
DNS-over-TLS stream should be reused rather than re-handshaked (RFC 7858 §3.4) —
`namespy.apps.Stub` wraps one bound `StubResolver` and speaks in all three drives
(`ask` to await, `ask_blocking` to block, `ask_callback` for a `on_done` callable),
as both a sync and an async context manager:

```python
from namespy.apps import Stub

with Stub(["1.1.1.1", "9.9.9.9"], dnssec_ok=True) as stub:  # engine and socket close on exit
    answer = stub.ask_blocking("example.com", "A")
```

Not every name belongs at the same server. `namespy.apps.RouteTable` is the
conditional-forwarding table (dnsmasq's `--server=/zone/ip`, deployment convention
rather than protocol): longest-suffix match, and a zone match *excludes* the
general path, so an internal name is never leaked to a public resolver. It decides
where a name would go and opens no socket — the forwarder (W4) is what acts on it:

```python
from namespy.apps import RouteTable

table = RouteTable(["internal.example=10.0.0.1"], default="1.1.1.1")
decision = table.route("db.internal.example")
print(decision.route.zone, decision.exclusive)  # internal.example  True  (default is off the table)
print(table.route("example.com").upstreams)  # 1.1.1.1 — only the general path matched
```

To run that table as a server, `namespy.apps.Forwarder` is the named composition —
a `DnsServer` front relaying to a `StubResolver` (client ID and question echoed,
`AA` cleared, silence answered with EDE 22), over UDP and TCP, with zero new core
code. It is the same objects, now an embeddable handle:

```python
from namespy.apps import Forwarder

fwd = Forwarder(["1.1.1.1", "9.9.9.9"])  # forwards everything to these recursors
fwd.serve()  # binds 127.0.0.1:53 (UDP + TCP)
print(fwd.stats())  # {'served': n, 'by_origin': {'forward': n}, 'servfail': 0}
fwd.stop()
```

Underneath all of them, the machinery is explicit. `RecursiveResolver` is an `asyncio.Protocol`: it owns a datagram endpoint and you
await `resolve()`.

```python
import asyncio
from namespy import DnsQType, DnsQuestion, DomainName, Query, RecursiveResolver


async def main():
    loop = asyncio.get_running_loop()
    transport, resolver = await loop.create_datagram_endpoint(
        RecursiveResolver,
        local_addr=("0.0.0.0", 0),  # ephemeral source port, RFC 5452 section 9.2
    )
    try:
        query = Query(questions=[DnsQuestion(DomainName("example.com."), DnsQType.A)])
        response = await asyncio.wait_for(resolver.resolve(query), timeout=10)
        for record in response.answers:
            print(record.name, record.rtype, record.ttl, record.rdata)
        print(resolver.last_trace.to_mermaid())
    finally:
        # Both halves: the socket asyncio handed you, and the private IPv6 socket
        # the resolver opened for itself to fetch AAAA glue.
        transport.close()
        await resolver.aclose()


asyncio.run(main())
```

One walk can answer more than one type. `resolve_bundle` asks for the extras in an
MQTYPE-Query option (RFC 10029), and what a server did not combine comes back as work
rather than as a verdict:

```python
bundle = await resolver.resolve_bundle(query, (DnsQType.AAAA, DnsQType.HTTPS))
for entry in bundle.types:
    print(entry.qtype, entry.state.value, len(entry.records))
print(bundle.still_needed)  # empty unless a type stayed unanswered
```

An answer that contradicts itself (§3.5: a duplicated QTx, the option twice) voids the
bundle *and* the primary answer, is reported in `bundle.void` and `bundle.reason`, and is
never cached — silence about a type, on the other hand, only means nobody answered it.

The pieces are useful apart from the resolver. Decoding a capture needs neither a
resolver nor an event loop:

```python
from namespy import DnsPacket
from namespy.rdata import RData_SOA

packet, consumed = DnsPacket.parse(raw_datagram)
print(packet.ID, packet.RCODE, packet.extended_rcode, packet.TC, len(packet.answers))

soa = RData_SOA("ns1.example.com", "hostmaster.example.com", 2026102701, 7200, 3600, 1209600, 3600)
bytes(soa)  # pointer-free, so it is storable anywhere
RData_SOA.serial_ahead(1, 0xFFFFFFFF)  # True — RFC 1982 serial arithmetic
```

Anything the codec does not know about stays readable rather than raising: an
`HTTPS` (65) or `ZONEMD` (63) record decodes to an opaque `RData` and renders in
RFC 3597 section 5 form, `\# 24 00046400...`, which is what RFC 3597 section 3
asks a receiver to do with a type it has never heard of.

## What it does not do

Listing these is more useful than a promise of completeness, because three of
them change the security properties of anything built on top.

- **DNSSEC validation is opt-in, and opt-in is not the same as complete.**
  `--validate` composes the DS→DNSKEY chain from the walk's own referrals,
  fetches what the chain lacks (RFC 4035 §5.2¶6), judges every RRset a response
  stands on, sets `AD` only on what its configured anchors vouched for
  (RFC 5155 §9.2¶1 subtracting Opt-Out), and refuses Bogus answers unless the
  client asked for CD (RFC 4035 §3.2.2¶3); RFC 9824's compact denials and the
  aggressive-NSEC and wildcard cache reuse ride the same verdicts. What is
  *not* there: validation runs only when anchors are configured (the IANA root
  document is fetched on `--validate` unless a file is given, and the store
  is now testable during a ceremony: a query for RFC 8509's
  `root-key-sentinel-is-ta-20326.` is answered only if tag 20326 is in the
  trust store *right now*, refusal-as-SERVFAIL otherwise —
  `namespy.anchors` holds the arithmetic, `DnsServer` the table); nothing
  re-fetches on a schedule, which stays an operator's cron-shaped decision —
  though the cron now has an RFC 5011 body to call: `namespy.maintenance` runs
  the managed-key state machine, hold-down-gated additions and immediate,
  self-signed revocations included, so anchors replace themselves instead of
  outliving their keys —
  and the walk cannot yet speak
  to DNS-over-QUIC servers at all. With no anchors configured nothing is
  verified, and answers
  are unauthenticated: anyone who can deliver a well-formed response that
  matches the question — same source address, same ID, echoed question — is
  believed.
- **EDNS(0) options are partial: NSID, Extended DNS Errors and MQTYPE are put to
  use.**
  Outbound queries advertise a 1232-octet UDP payload (RFC 6891 §6.1.2, disable with
  `--no-edns` or the constructor knob), arriving OPT records yield `extended_rcode`,
  the DNSSEC-request and compact-answers flags (`dnssec_ok`, `compact_answers_ok`,
  RFC 6891 §6.1.4 and RFC 9824 §5.1) and `requestor_payload_size`, and a
  FORMERR/BADVERS/NOTIMP answer
  *without* an OPT alongside it triggers the §6.2.2 unextended re-ask. Option TLVs
  (§6.1.2) are carried in both directions: `--nsid` asks each server the walk touches
  who it is and prints the answers as hex (RFC 5001 §2.4), and what a server advertises
  becomes the ceiling on the next query sent to it (§6.2.3, §6.2.4). Extended DNS Errors
  (RFC 8914) go both ways as well — the bundled server explains a failure it caused
  (22 behind a SERVFAIL that ran out of authoritative servers, 21 behind a NOTIMP), and
  a code that arrives is printed as `; EDE:` on any rcode (§3 requires a receiver to
  accept them beside a NOERROR too) and folded into the reason a cached failure
  remembers. It is never *acted on*: §6 says the content "MUST NOT alter DNS protocol
  processing" and calls it unauthenticated, so an attacker who can deliver a response
  can deliver an explanation with it. An upstream code is not forwarded to this
  resolver's own client, which §3 leaves to the implementation and this implementation
  declines. COOKIE (RFC 7873) encodes and decodes but is not yet *used*:
  there is no server-side cookie state to validate a reply against — the
  server only refuses a COOKIE whose length is impossible (§5.2.2). Padding
  (RFC 7830) is *used* where §6 allows it: queries leaving over an encrypted
  leg — the stub's DoT and DoH upstreams, the walk's opportunistic DoT under
  `--dot-authority` — are padded to RFC 8467 §4.1's 128-octet blocks
  (`--no-query-padding` declines), and the plaintext legs never carry the
  option whatever the knobs say. The server side stays silent by the same
  section: its only front is cleartext UDP. MQTYPE (RFC 10029) is answered and, since this round,
  asked as well: both
  option codes compose and parse (`namespy/mqtype.py`), the bundled server refuses every
  malformed MQTYPE-Query §3.3 lists, and given a well-formed one it combines the extra
  QTYPEs into the answer and returns the §3.4 MQTYPE-Response naming exactly the
  types it folded in whole. An empty list beside a failure says "supported, nothing
  combined";
  silence stays the way a server that never heard of the extension looks, so a reply to
  every valid query carries the option even when it holds nothing. §4's operator knob is
  the server's `max_qtypes` — `--max-qtypes` on the demo server, four by default, which
  is the figure §4 calls appropriate for public DNS — and zero is the setting that
  answers the option without ever buying the extra lookups. A response that cannot carry
  one more type stops combining rather than truncating: §3.4's rule that a listed QTx is
  present in full outranks the wish to answer everything at once. Asking is `--mqtype TYPE`
  (repeatable), or `RecursiveResolver.resolve_bundle(packet, (AAAA, HTTPS))` from code: one
  descent answers all three, `namespy/bundle.py` reads what came back, and any type the
  answer did not combine gets its own query (§3.5) rather than a negative — §3.5's four
  reasons for leaving a QTx out are all about the server and none of them is "this name has
  no such records". A server that has never seen option 20 costs time and no answer; a
  server that answers a bundle invalidly has the whole reply discarded before any of it can
  reach the cache. The
  demo server answers an extended query
  with an OPT of its own — never a forwarded one, always its own payload size, and its
  identifier only if it was given one with `--advertise-nsid` and only if the
  query asked — and keeps §7's silence for a query that had none. Truncation is
  fully handled on both sides of a datagram: the server truncates its own UDP
  answers back from the end to what the client advertised, TC set, never below
  header, question, and OPT (RFC 6891 §6.2.3, §7 ¶6; RFC 1035 §6.2; RFC 10001
  §4.2 ¶4 asks recursive servers to answer without fragmenting), and a `TC`
  answer it receives is re-asked over TCP instead of being believed
  (RFC 1123 §6.1.3.2).
- **The IDNA2008 character tables do not ship.** Conversion at the
  boundary is complete — `namespy münchen.de`, `DomainName.from_unicode`,
  punycode (RFC 3492 §6) and the U-label/A-label tests (RFC 5891 §4-§5) —
  but RFC 5892's derived validity tables and IDNA2003-style or UTS-46
  mapping do not belong in a zero-dependency package, so contextual
  characters get the treatment RFC 5891 §5.4 ¶13 prescribes: ask the DNS,
  where a registered label is presumed valid. Below the boundary labels
  stay octets end to end, which is what RFC 2181 §11 requires of an
  implementation; a bare `DomainName` still means exactly what it says.
- **QNAME minimisation is opt-in** (`--qname-min`, `qname_min=True`). By
  default the full QNAME goes to every server on the way down, leaking the
  whole name to the root and TLD servers (RFC 9156 §4.1); with it on, each
  server sees only the labels the previous referral proved relevant, at the
  cost of more queries. `--trace` marks the probe queries, and budget
  exhaustion degrades back to full names rather than failing.
- **SHA-1 DNSSEC signatures are believed by no one by default** (RFC 9905
  §2, RFC 9906 §2). RSASHA1 (5) and RSASHA1-NSEC3-SHA1 (7) are deprecated for
  signing and ECC-GOST (12) retired: a zone signed only with them now answers
  as **insecure** — served, unsigned, no AD — rather than bogus or broken, and
  DS records naming those algorithms (or the GOST digest) introduce nothing at
  all, opt-in or not. The validation arithmetic itself is kept, because RFC
  9905 §2¶2 MUSTs it, and `--allow-sha1-dnssec` (`allow_deprecated_sha1=True`)
  re-opens it for reading zones mid-migration that are still signed with them.
- **Failure caching is coarse, on purpose** (`FailureCache`, RFC 9520 §3.2). A name
  that just failed — or any name under a zone whose servers just stopped answering
  (§3.3) — is answered `SERVFAIL` for one second to five minutes without a query
  leaving the process, and a successful lookup clears what was remembered about the
  name and about every zone that spoke during it. What is *not* cached is an
  unresponsive server *address*, which §3.2 permits: within a lookup the Slist
  already cycles a zone's remaining servers, and across lookups an address key would
  retire one of a zone's several healthy servers for minutes over a single dropped
  datagram. `--no-failure-cache` (`failure_cache=False`) turns it off, which is what
  a resolver built to watch a zone fail needs — one that has stopped asking is, from
  outside, indistinguishable from one that is itself broken.
- **Bailiwick is enforced on glue only, and it is now observable.** A referral's
  address records are accepted for a nameserver name inside the answering zone or
  inside the zone it delegates (RFC 5452 §6, RFC 1034 §4.2.1); anything else is
  discarded and that server's address is resolved from its own authority instead.
  What a delegation volunteered used to vanish inside the classifier; it is now a
  `VolunteeredGlue` trace event, refused or believed. `GluePolicy.PERMISSIVE`
  (`--allow-out-of-bailiwick-glue`) makes the refused addresses take effect, which
  is how you measure the exposure rather than merely assert it — diagnostics only,
  and it says so at startup. Answers and negative assertions are still stored for
  the queried name only, so there is nothing else for a referral to smuggle.
- **Not a name server.** No zone storage, no serving of a zone, no AXFR/IXFR. The
  bundled `DnsServer` answers from the resolver for loopback testing, over UDP
  and — because BCP 235 makes TCP non-optional — over TCP too
  (`DnsStreamServer`, speaking length-framed queries with the
  edns-tcp-keepalive conversation).
- **The recursive walk speaks Do53** — UDP with TCP for truncation and
  timeouts, those streams held and reused (RFC 7766 §6.2.1, paced by RFC
  7828's keepalive) rather than opened per query — unless `--dot-authority`
  opts it into RFC 9539 §4 opportunistic encryption: the walker then asks
  each authority's RFC 9461 `_dns` SVCB record for the port to try, probes
  it with DNS over TLS, races the probe against cleartext while the outcome
  is unknown, and remembers the verdict per address
  (certificates accepted as they come — the trust here is DNSSEC's, and
  rejecting one would force a cleartext fallback, which is the leak).
  Queries leaving over that TLS leg are padded to RFC 8467 §4.1's
  128-octet blocks (the SHOULD of RFC 9539 §4.6.8.1); the cleartext twin
  of every race is never padded (RFC 7830 §6), and `--no-query-padding`
  declines the padding on all encrypted legs.
  DNS over QUIC (RFC 9250) and
  mDNS/DNS-SD (RFC 6762, RFC 6763) are not spoken anywhere. The stub's
  forwarded leg offers more: UDP, TCP, TLS (RFC 7858) and HTTPS
  (RFC 8484, HTTP/2 via the optional `doh` extra) — see `--stub-transport`.

Of these, the DNSSEC and EDNS entries are the ones worth re-reading before
you depend on this for anything that needs authenticity. The full
obligation-level picture, gap by gap, is
[`docs/roadmap.md`](docs/roadmap.md).

## Development

See [`CONTRIBUTING.md`](CONTRIBUTING.md). The short version — all four must pass.
The two pytest runs happen on Linux and Windows alike, because a socket option
that exists only on Linux is exactly the kind of bug a Linux-only CI never sees;
lint, typing and the distribution checks run once on Linux.

```bash
pytest -q --cov                          # coverage floor enforced by pyproject
python -O -m pytest -q                   # assertions stripped
ruff check . && ruff format --check .
mypy namespy
```

The second line is the one that matters most here: `python -O` strips `assert`,
and a parser whose bounds checks were `assert` stops being a parser under
production flags. The `--cov` on the first is not decoration either — pytest
reads `fail_under` through pytest-cov, and pytest-cov only runs when asked, so
`pytest -q` alone passes whatever it covers. Suite and policy details are in
`SECURITY.md`.

## License

Apache-2.0 — see [`LICENSE`](LICENSE).
