Skip to main content

dnsLookup

A Workflow Engine function that performs a lookup of an IP address or name to return the following object:

{
  "name" : <resolved name>,
  "address" : <resolved address>,
  "fqdn" : <resolved fqdn> 
}

The functon uses the underlying dnsLookup bot utility and caches results. Repeated queries for the same data use the cached values. Caching happens at the Moogfarmd level. You can edit the Moogfarmd configuration if needed. See Java 11 Networking Properties and Java 8 Network Properties for details on caching and configuration.

By default the cache lasts the lifetime of the JVM. You can add the appropriate flags and caching duration to the Moogfarmd startup. The function writes the results from the DNS lookup to the workflowContext.dnsDetails for use in other actions. Returns null when the DNS lookup fails to find any details for an IP address. To prevent unpredictable behavior, check the returned data for null before using it in a downstream actions.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function dnsLookup takes the following arguments:

Name

Required

Type

Description

lookup

yes

string

Object field containing the value to look up.

Example

The following example demonstrates typical use of Workflow Engine function dnsLookup. To lookup the DNS entry for the source field, set the following:

  • lookup: source

The UI translates your settings to the following JSON:

{"lookup":"source"}

For an alert where source = 198.51.100.12, the function updates the workflowContext as follows:

"dnsDetails": {
    "address": "198.51.100.12",          
    "fqdn": "sflinux101.example.com",
    "name": "sflinux101"
}