Skip to content

lookup_addr

kumo.dns.lookup_addr(NAME, OPT_RESOLVER_NAME)
Since: Version 2023.08.22-4d895015

The functionality described in this section requires version 2023.08.22-4d895015 of KumoMTA, or a more recent version.

Resolve the A and AAAA records for the requested NAME.

Raises an error if the name doesn't exist in DNS.

Returns an array style table listing the IPv4 and IPv6 addresses as strings.

DNS results are cached according to the TTL specified by the DNS record itself.

print(kumo.json_encode(kumo.dns.lookup_addr 'localhost'))

-- prints out:
-- ["127.0.0.1","::1"]
Since: Version 2025.12.02-67ee9e96

The functionality described in this section requires version 2025.12.02-67ee9e96 of KumoMTA, or a more recent version.

The OPT_RESOLVER_NAME is an optional string parameter that specifies the name of a alternate resolver defined via define_resolver. You can omit this parameter and the default resolver will be used.