DNS Lookup
Synopsis
Performs DNS lookups on domains or IP addresses, and caches the results.
Schema
dns_lookup:
- field: <ident>
- type: <string>
- resource_type: <string>
- target_field: <ident>
- dns_server: <string>
- cache_ttl: <number>
- description: <text>
- if: <script>
- ignore_failure: <boolean>
- ignore_missing: <boolean>
- on_failure: <processor[]>
- on_success: <processor[]>
- tag: <string>
Configuration
Field | Required | Default | Description |
---|---|---|---|
field | Y | - | Field containing domain/IP to lookup |
type | Y | - | Lookup type: forward or reverse |
resource_type | N | A | DNS record type for forward lookups: A , AAAA , MX , TXT |
target_field | N | field | Field to store lookup results |
dns_server | N | - | Custom DNS server (e.g., "8.8.8.8:53") |
cache_ttl | N | 30 | Cache TTL in minutes |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue if lookup fails |
ignore_missing | N | false | Continue if source field doesn't exist |
on_failure | N | - | See Handling Failures |
on_success | N | - | See Handling Success |
tag | N | - | Identifier |
Details
The processor does both forward and reverse lookups, and can handle multiple DNS record types and custom DNS servers. IPv6 addresses are fully supported for both forward and reverse lookups.
Private IP addresses typically won't have PTR records.
All results are cached to improve performance.
Cache entries expire based on the configured TTL. Large cache sizes can impact memory usage.
Multiple results are returned as arrays. Non-string field values will cause errors. Conditional execution and success/failure handling are also supported.
DNS lookups can introduce latency to event processing.
Examples
Forward
Looking up IPv4 addresses for a domain... |
|
adds the resolved IPs to the event: |
|
IPv4 Reverse
Looking up the hostname for IPv4 address... |
|
adds the resolved hostname to the event: |
|
IPv6 Reverse
Looking up the hostname for IPv6 address... |
|
resolves the IPv6 address to the hostname: |
|
MX Record
Looking up mail servers for a domain... |
|
adds the MX records to the event: |
|
Custom Server
Using Cloudflare DNS for lookups... |
|
resolves the specified DNS server: |
|
Private IPs
Handling lookup failures for private IPs... |
|
continues the execution: |
|
Conditionals
Performing the look up only for debug events... |
|
skips irrelevant information: |
|