Skip to content

lookup_ptr

kumo.dns.lookup_ptr(IP, OPT_RESOLVER_NAME)
Since: Version 2025.10.06-5ec871ab

The functionality described in this section requires version 2025.10.06-5ec871ab of KumoMTA, or a more recent version.

Resolve PTR records for the requested IP.

Raises an error if there was an issue resolving the record.

Returns a lua array-style table with the list of PTR records returned from DNS. The table may be empty.

local ok, records = pcall(kumo.dns.lookup_ptr, '127.0.0.1')
if ok then
  for _, a in ipairs(records) do
    print(a)
  end
end
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_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.