Resolves hostnames using reverse DNS lookups.

ParameterTypeRequiredDefaultDescription
asstringoptional[a]hostname Specifies the field into which the resolved value is stored.
field[b]stringrequired  Specifies the field to run the RDNS lookup against.
serverstringoptional[a]  Specifies a DNS server address.

[a] Optional parameters use their default value unless explicitly set

[b] The argument name field can be omitted.

Omitted Argument Names

The argument name for field can be omitted; the following forms of this function are equivalent:

logscale
rdns("value")

and:

logscale
rdns(field="value")

If a lookup fails, it will keep the event but not add the given field.

For self-hosted customers, the number of resulting events from this function is limited by the configuration parameter MAX_STATE_LIMIT, whose default limit is 20000. If the number of events exceeds this limit, the result will be truncated with a warning.

To prevent the rdns function from blocking query execution for an indeterminate amount of time, a timeout is applied to all RDNS requests. If an RDNS request doesn't return a result within the timeout, the lookup is considered to have failed for the associated event. However, if the request eventually returns, its result is added to an internal cache within LogScale for a period of time. Therefore, a static query using the rdns function may fail a lookup for an event on its first execution, but succeed in a subsequent execution. In live queries this behaviour is less of a problem, as the rdns function will be evaluated continually. Thus, it is preferable to mainly use the rdns function in live queries.

Note

Reverse DNS can generally not be considered authoritative and should only be considered informational. The owner of an IP address can change it to point to an arbitrary hostname.

For an authoritative alternative without the above limitations, consider using asn() instead.

If no RDNS server is specified then a system default is used. This can be overwritten via server to select a different default server.

For self-hosted customers, the allowed IP addresses and servers that can be queried can be restricted by setting:

  • IP_FILTER_RDNS – for filtering which IP addresses one may do reverse dns queries against.

  • IP_FILTER_RDNS_SERVER – for filtering which DNS servers may be specified in the function.

rdns() Examples

Resolve ipAddress (if present) using the server 8.8.8.8, and store the resulting DNS name in dnsName

logscale
rdns(ipAddress, server="8.8.8.8", as=dnsName)

Resolve ipAddress (if present) and store the resulting DNS name in hostname

logscale
rdns(ipAddress)