AutomationFlowsWeb Scraping › Perform Multi-type DNS Lookups with Google DNS

Perform Multi-type DNS Lookups with Google DNS

Original n8n title: Perform Multi-type Dns Lookups with Google's Free Public Dns Service

ByOssian Madisson @ossian on n8n.io

Track changes:* Schedule execution and log DNS answers to track changes to records over time.

Event trigger★★★★☆ complexity12 nodesHTTP RequestForm Trigger
Web Scraping Trigger: Event Nodes: 12 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #10200 — we link there as the canonical source.

This workflow follows the Form Trigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "BXm0BiyrBflaibCy",
  "name": "Free DNS lookup (dns.google)",
  "tags": [],
  "nodes": [
    {
      "id": "4340255d-eab4-43f8-a081-c81eb61f4e2b",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        928,
        656
      ],
      "parameters": {
        "include": "allOtherFields",
        "options": {},
        "fieldToSplitOut": "Types"
      },
      "typeVersion": 1
    },
    {
      "id": "216ec461-7be9-423c-8898-467ca3435306",
      "name": "DNS Lookup",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1312,
        672
      ],
      "parameters": {
        "url": "https://dns.google/resolve",
        "options": {},
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "={{ $json.Domain }}"
            },
            {
              "name": "type",
              "value": "={{ $json.Types }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "a1a9cb2e-55b0-4de3-b4dd-481960fdf74f",
      "name": "Set human readable type in output",
      "type": "n8n-nodes-base.code",
      "position": [
        1520,
        672
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  item.json.type_hr = $('For each DNS type').first().json.Types;\n}\n\nreturn $input.all();"
      },
      "typeVersion": 2
    },
    {
      "id": "7e513dfd-7487-4018-9156-d0a64f65a5e6",
      "name": "Aggregate results",
      "type": "n8n-nodes-base.code",
      "position": [
        1440,
        320
      ],
      "parameters": {
        "jsCode": "// Initialize variables to aggregate data across all input items\nlet domain = null;\nconst records = [];\n\n// Loop over input items to process and aggregate the data\nfor (const item of $input.all()) {\n  const itemJson = item.json;\n\n  // 1. Get the domain name from the first item's Question array\n  // Check if domain is not yet set and Question array exists\n  if (domain === null && itemJson.Question && itemJson.Question.length > 0) {\n    // Extract domain and remove the trailing dot if present\n    domain = itemJson.Question[0].name.replace(/\\.$/, '');\n  }\n\n  // Get the human-readable type from the current item\n  // Fallback to a placeholder if 'type_hr' is missing\n  const recordType = itemJson.type_hr || 'UNKNOWN';\n\n  // 2. Process all answers or insert \"NO ANSWER\" placeholder\n  const answerRecords = itemJson.Answer;\n\n  if (answerRecords && answerRecords.length > 0) {\n    // SUCCESS: Loop over existing answer records\n    for (const record of answerRecords) {\n      // Add the new record object using the top-level type_hr\n      records.push({\n        type: recordType,\n        data: record.data\n      });\n    }\n  } else {\n    // FAILURE: Insert \"NO ANSWER\" placeholder for the current type\n    records.push({\n      type: recordType,\n      data: \"NO ANSWER\"\n    });\n  }\n}\n\n// 3. Construct the final output object in the desired n8n format\n\n// Create a new item that contains the aggregated data\nconst outputItem = {\n    json: {\n        domain: domain,\n        records: records\n    }\n};\n\n// Return a new array containing only the single aggregated output item\nreturn [outputItem];"
      },
      "typeVersion": 2
    },
    {
      "id": "f1703e6f-9e88-4f65-af93-a42d5f94e3ff",
      "name": "Default to all DNS types",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        576
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"Domain\": \"{{ $json.Domain }}\",\n  \"Types\": [\"A\",\"CNAME\",\"AAAA\",\"MX\",\"TXT\",\"NS\"]\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "8b95a121-bb65-4a92-8f7d-12ae75e44209",
      "name": "Use selected DNS types",
      "type": "n8n-nodes-base.set",
      "position": [
        736,
        752
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"Domain\": \"{{ $json.Domain }}\",\n  \"Types\": {{ $json[\"Types (leave empty to use all)\"] }}\n}\n"
      },
      "typeVersion": 3.4
    },
    {
      "id": "3f01a762-2608-49c0-bb3a-e37c72405e86",
      "name": "If no DNS type in input",
      "type": "n8n-nodes-base.if",
      "position": [
        560,
        656
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "69423fc7-bf38-4c05-8172-71c6155f550e",
              "operator": {
                "type": "array",
                "operation": "empty",
                "singleValue": true
              },
              "leftValue": "={{ $json[\"Types (leave empty to use all)\"] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "49a5b001-6bc4-46c6-aea2-9ee9d72ee147",
      "name": "For each DNS type",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1104,
        656
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "24035b9b-a88a-42d2-98ba-115a6c76ccd2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        144
      ],
      "parameters": {
        "width": 416,
        "height": 368,
        "content": "## Outputs an aggregated list of the DNS lookup results"
      },
      "typeVersion": 1
    },
    {
      "id": "d4a8faa0-9cae-40fa-bbf2-76cc88ddebc7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        528
      ],
      "parameters": {
        "color": 6,
        "width": 1472,
        "height": 416,
        "content": "## Loops over each type and executes a DNS lookup"
      },
      "typeVersion": 1
    },
    {
      "id": "b0696455-1381-4af8-a709-a3643a4a077f",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        144
      ],
      "parameters": {
        "color": 5,
        "width": 1040,
        "height": 368,
        "content": "## Information\nTemplate created by Smultron Studio (https://smultronstudio.com/en) - feel free to reach out at hello@smultronstudio.com\n\n### Instructions:\n* Use the Form input to enter a domain and select DNS types to lookup\n* Hook up the aggregated results output to your use case\n\n#### Modifications:\nIf you want to add additional DNS types to \"ALL\" you need to modify these nodes, the rest of the workflow will adapt automatically:\n* Default to all DNS types\n* Form input\n\n#### List of DNS type ids if you want to add more:\nComplete list: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2cbf850c-81dd-49f5-906c-39843df897e6",
      "name": "Form input",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        352,
        656
      ],
      "parameters": {
        "options": {},
        "formTitle": "DNS lookup",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Domain",
              "placeholder": "domain.tld",
              "requiredField": true
            },
            {
              "fieldType": "checkbox",
              "fieldLabel": "Types (leave empty to use all)",
              "fieldOptions": {
                "values": [
                  {
                    "option": "A"
                  },
                  {
                    "option": "CNAME"
                  },
                  {
                    "option": "AAAA"
                  },
                  {
                    "option": "MX"
                  },
                  {
                    "option": "TXT"
                  },
                  {
                    "option": "NS"
                  }
                ]
              }
            }
          ]
        },
        "responseMode": "lastNode"
      },
      "typeVersion": 2.3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6e212175-c9e3-40b5-80c7-128e64d07e6b",
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "For each DNS type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "DNS Lookup": {
      "main": [
        [
          {
            "node": "Set human readable type in output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Form input": {
      "main": [
        [
          {
            "node": "If no DNS type in input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "For each DNS type": {
      "main": [
        [
          {
            "node": "Aggregate results",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "DNS Lookup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Use selected DNS types": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If no DNS type in input": {
      "main": [
        [
          {
            "node": "Default to all DNS types",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Use selected DNS types",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Default to all DNS types": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set human readable type in output": {
      "main": [
        [
          {
            "node": "For each DNS type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Track changes:* Schedule execution and log DNS answers to track changes to records over time.

Source: https://n8n.io/workflows/10200/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

This workflow allows you to import any workflow from a file or another n8n instance and map the credentials easily. A multi-form setup guides you through the entire process At the beginning you have t

Execute Command, Read Write File, HTTP Request +3
Web Scraping

[n8n] Advanced URL Parsing and Shortening Workflow - Switchy.io Integration. Uses splitInBatches, stickyNote, httpRequest, html. Event-driven trigger; 56 nodes.

HTTP Request, GitHub, Stop And Error +1
Web Scraping

[](https://youtu.be/c7yCZhmMjtI)

HTTP Request, GitHub, Stop And Error +1
Web Scraping

N8n recently introduced folders and it has been a big improvement on workflow management on top of the tags.

HTTP Request, n8n, Form Trigger +1
Web Scraping

This workflow automates the creation of press releases for music artists releasing a new single. Upload your MP3, fill in basic info, and receive a publication-ready press release saved as a Google Do

Form Trigger, HTTP Request, Google Docs