mix-dns
@nymproject/mix-dns (opens in a new tab) resolves hostnames to IPs through the Nym mixnet. The query travels as a UDP datagram to a public resolver via the IPR (Internet Packet Router) exit gateway, not through the browser or OS resolver.
┌──────────────────────────────────────────────────────────────┐
│ Your browser app │
│ └─ mixDNS('example.com') │
│ └─ mix-tunnel (smolmix-wasm, Web Worker) │
│ └─ UDP datagram via the IPR │
│ └─ public resolver (default 8.8.8.8:53) │
└──────────────────────────────────────────────────────────────┘The resolver sees a query from the IPR's IP, not yours, and the browser's own resolver path (the OS stub resolver, any local DoH) is bypassed entirely.
When to use it
mix-dns is for cases where you need the resolved IP itself, not a connection that uses it. mix-fetch and mix-websocket already resolve via the mixnet internally; you don't need to call mixDNS before either.
Direct uses:
- Validate that a hostname resolves to an expected IP range before connecting through any path.
- Build IP-based allow / deny lists for an app that performs the connection itself.
- Probe whether a hostname is reachable from the IPR exit's perspective without opening a connection.
In this section
- Get started: install and resolve your first hostname.
- Reference & security: configure the resolver, and what it sees.
- TypeDoc reference: generated from the source.
- Browser example (opens in a new tab): a runnable example app.