node:dns
#Import
import dns from "nstdlib/dns";Note
Its behavior matches Node.js. Details: queries run over DNS-over-HTTPS on the host fetch. lookup, resolve4/6/Cname/Ns/Ptr/Txt/Mx/Srv/Soa and reverse are real. lookupService, setServers, setLocalAddress and resolveAny/Naptr/Tlsa/Caa throw by name.
#Runtime support
| Where it runs | Status | Export coverage | Details |
|---|---|---|---|
| nstd | ⚠️ some support | – | 4/31 of Node's own eligible tests pass under nstd. |
| Browser | ❔ not tested | 100% of Node.js | It imports with the small process shim. 50/50 Node.js exports are available. No module-specific behavior test ran. |
| Node.js (host) | ✅ works | 100% of Node.js | 50/50 exports. |
#Exports (50 of 50)
Each cell shows what happens when code reads an export:
- ✅ Available through every import style. A named error also counts.
- ⚠️ Available through only some import styles.
- ❔ The export exists but has no value.
- ❌ The export does not exist.
- – This environment was not measured.
Show all 50 exports
| Export | Node.js | nstdlib | browser |
|---|---|---|---|
ADDRCONFIG | ✅ | ✅ | ✅ |
ADDRGETNETWORKPARAMS | ✅ | ✅ | ✅ |
ALL | ✅ | ✅ | ✅ |
BADFAMILY | ✅ | ✅ | ✅ |
BADFLAGS | ✅ | ✅ | ✅ |
BADHINTS | ✅ | ✅ | ✅ |
BADNAME | ✅ | ✅ | ✅ |
BADQUERY | ✅ | ✅ | ✅ |
BADRESP | ✅ | ✅ | ✅ |
BADSTR | ✅ | ✅ | ✅ |
CANCELLED | ✅ | ✅ | ✅ |
CONNREFUSED | ✅ | ✅ | ✅ |
DESTRUCTION | ✅ | ✅ | ✅ |
EOF | ✅ | ✅ | ✅ |
FILE | ✅ | ✅ | ✅ |
FORMERR | ✅ | ✅ | ✅ |
LOADIPHLPAPI | ✅ | ✅ | ✅ |
NODATA | ✅ | ✅ | ✅ |
NOMEM | ✅ | ✅ | ✅ |
NONAME | ✅ | ✅ | ✅ |
NOTFOUND | ✅ | ✅ | ✅ |
NOTIMP | ✅ | ✅ | ✅ |
NOTINITIALIZED | ✅ | ✅ | ✅ |
REFUSED | ✅ | ✅ | ✅ |
Resolver | ✅ | ✅ | ✅ |
SERVFAIL | ✅ | ✅ | ✅ |
TIMEOUT | ✅ | ✅ | ✅ |
V4MAPPED | ✅ | ✅ | ✅ |
getDefaultResultOrder | ✅ | ✅ | ✅ |
getServers | ✅ | ✅ | ✅ |
lookup | ✅ | ✅ | ✅ |
lookupService | ✅ | ✅ | ✅ |
promises | ✅ | ✅ | ✅ |
resolve | ✅ | ✅ | ✅ |
resolve4 | ✅ | ✅ | ✅ |
resolve6 | ✅ | ✅ | ✅ |
resolveAny | ✅ | ✅ | ✅ |
resolveCaa | ✅ | ✅ | ✅ |
resolveCname | ✅ | ✅ | ✅ |
resolveMx | ✅ | ✅ | ✅ |
resolveNaptr | ✅ | ✅ | ✅ |
resolveNs | ✅ | ✅ | ✅ |
resolvePtr | ✅ | ✅ | ✅ |
resolveSoa | ✅ | ✅ | ✅ |
resolveSrv | ✅ | ✅ | ✅ |
resolveTlsa | ✅ | ✅ | ✅ |
resolveTxt | ✅ | ✅ | ✅ |
reverse | ✅ | ✅ | ✅ |
setDefaultResultOrder | ✅ | ✅ | ✅ |
setServers | ✅ | ✅ | ✅ |