Skip to content

lookup_addr

kumo.dns.lookup_addr(NAME, OPT_RESOLVER_NAME, OPT_STRATEGY)
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 parameter 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.

Since: Dev Builds Only

The functionality described in this section requires a dev build of KumoMTA. You can obtain a dev build by following the instructions in the Installation section.

The OPT_STRATEGY parameter is an optional string parameter that specifies the IPv4 vs. IPv6 lookup strategy. Allowable values and default behavior (if you omit this parameter) are the same as those described in ip_lookup_strategy.