Constructors

  • Parameters

    Returns default

Properties

servers: string[]

The DNS servers used to make queries. Can be overridden - doing so will clear the cache.

Methods

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • An asynchronous function which returns cached DNS lookup entries. This is the base for lookupAsync(hostname, options) and lookup(hostname, options, callback).

    Parameters

    • hostname: string

    Returns Promise<readonly EntryObject[]>

  • An asynchronous function which makes a new DNS lookup query and updates the database. This is used by query(hostname, family) if no entry in the database is present. Returns an array of objects with address, family, ttl and expires properties.

    Parameters

    • hostname: string

    Returns Promise<readonly EntryObject[]>

  • Attaches itself to an Agent instance.

    Parameters

    Returns void

  • Removes itself from an Agent instance.

    Parameters

    Returns void

  • Updates interface info. For example, you need to run this when you plug or unplug your WiFi driver.

    Note: Running updateInterfaceInfo() will trigger clear() only on network interface removal.

    Returns void

  • Clears the cache for the given hostname. If the hostname argument is not present, the entire cache will be emptied.

    Parameters

    • Optionalhostname: string

    Returns void