hammerspoon2-docs
    Preparing search index...

    Function resolve

    • Asynchronously resolves a hostname to its IP addresses using the system DNS resolver. Uses CFHost, which respects the system's network configuration including VPN routes and proxy settings.

      Parameters

      • hostname: string

        The hostname to resolve (e.g. "example.com" or "localhost").

      • Optionalfamily: string | null

        The address family to query: "ipv4" for A records only, "ipv6" for AAAA records only, or "both" to return all addresses. Defaults to "both" when omitted.

      Returns Promise<string[]>

      A Promise that resolves to an array of IP address strings, or rejects with an error message if the lookup fails.