Node-style lookup: resolves a name to its first address as a string.
Tries A first (or AAAA when family: 6), then falls back to the other family when family is 0 (the default). Returns undefined when the name has no address.
A
AAAA
family: 6
family
0
undefined
The domain name.
Resolver options plus an optional address family (0 | 4 | 6).
4
6
The first address, or undefined if unresolved.
1.0.4
import { lookup, RESOLVERS } from 'edgeport/dns';const ip = await lookup('example.com', { server: RESOLVERS.google }); Copy
import { lookup, RESOLVERS } from 'edgeport/dns';const ip = await lookup('example.com', { server: RESOLVERS.google });
Node-style lookup: resolves a name to its first address as a string.
Tries
Afirst (orAAAAwhenfamily: 6), then falls back to the other family whenfamilyis0(the default). Returnsundefinedwhen the name has no address.