edgeport - v1.0.6
    Preparing search index...

    Function lookup

    • 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.

      Parameters

      • name: string

        The domain name.

      • opts: LookupOptions = {}

        Resolver options plus an optional address family (0 | 4 | 6).

      Returns Promise<string | undefined>

      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 });