Resolves hostnames using reverse DNS lookups.

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.
limitnumberoptional[a]RdnsDefaultLimit Limits the number of resulting events in the RDNS request, controlled by the corresponding dynamic configurations.
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:




These examples show basic structure only; full examples are provided below.

Usage notes:

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

  • The number of resulting events from this function is limited by the dynamic configuration parameter RdnsMaxLimit. 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.

  • 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.

  • The default list of IP address ranges that are disallowed by rdns() are listed below:

    # IPv4
    # See          # RFC791 (         # RFC1122 (         # RFC1918 (      # RFC6598 (        # RFC1122 (     # RFC3927 (      # RFC1918 (       # RFC6890 (       # RFC7335 (       # RFC7600 (       # RFC7723 (      # RFC8155 (     # RFC8880 (     # RFC7050 (       # RFC5737 (    # RFC7535 (    # RFC7450 (     # RFC7526 (     # RFC1918 (    # RFC7534 (      # RFC2544 (    # RFC5737 (     # RFC5737 (        # RFC1112 ( # RFC8190 (
    # IPv6
    # See
    ::/128             # RFC4291 (
    ::1/128            # RFC4291 (
    ::ffff:0:0/96      # RFC4291 (
    64:ff9b::/96       # RFC6052 (
    64:ff9b:1::/48     # RFC8215 (
    100::/64           # RFC6666 (
    2001::/23          # RFC2928 (
    2001::/32          # RFC8190 (
    2001:1::1/128      # RFC7723 (
    2001:1::2/128      # RFC8155 (
    2001:2::/48        # RFC5180 (
    2001:3::/32        # RFC7450 (
    2001:4:112::/48    # RFC7535 (
    2001:10::/28       # RFC4843 (
    2001:20::/28       # RFC7343 (
    2001:30::/28       # RFC9374 (
    2001:db8::/32      # RFC3056 (
    2002::/16          # RFC3056 (
    2620:4f:8000::/48  # RFC7534 (
    fc00::/7           # RFC8190 (
    fe80::/10          # RFC4291 (

    Last updated in v1.129.

  • 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, and store the resulting DNS name in dnsName

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

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