Multi-Type DNS Lookup and Aggregation using Google DNS - n8n Workflow

Use this powerful n8n workflow to perform simultaneous A, CNAME, AAAA, MX, and TXT DNS lookups via Google Public DNS and aggregate the detailed results into a single clean output item.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

System Administrators: Who need to quickly check the configuration of multiple DNS records (A, CNAME, MX, TXT). Developers: Building tools that require validating domain infrastructure setup. n8n Automation Specialists: Looking for robust n8n templates for network and DevOps monitoring tasks. Web Marketers/SEO Experts: Needing aggregated data on domain records for technical audits.

Overview

Network diagnostics often require querying various DNS record types (A, MX, CNAME) simultaneously. Manually running these queries is time-consuming. This n8n workflow solves this by automating the entire process. It uses the Google Public DNS API, which offers reliable and free resolution services.

This robust n8n workflow accepts a single domain name and an optional list of record types. If no types are specified, it defaults to checking the six most common types. It then executes individual DNS lookups for each type using an http request n8n node and finally uses custom code logic to combine all success and failure results into a single, structured JSON item. This makes the resulting data easy to consume by downstream applications or other n8n templates.

How it Works


  1. Form Input (n8n trigger): The process starts with the Form input n8n trigger, capturing the target domain name and an optional list of DNS record types (A, CNAME, AAAA, MX, TXT, NS).

  2. Type Check (If n8n node): The If no DNS type in input n8n node checks if the user provided specific types. If empty, the flow defaults to checking all six common record types via the Default to all DNS types n8n node.

  3. Preparation (Split Out n8n node): The data is prepared for iteration by splitting the input item based on the array of selected Types, ensuring one item per record type.

  4. Execution Loop: The For each DNS type n8n node creates a batch loop.

  5. DNS Query (HTTP Request n8n node): The DNS Lookup n8n node executes an HTTP GET request to https://dns.google/resolve, dynamically inserting the domain and the current DNS type in the query parameters.

  6. Type Preservation (Code n8n node): After the lookup, the Set human readable type in output n8n node ensures that the human-readable record type (A, CNAME, etc.) is attached to the raw API response, which is crucial for the final aggregation step.

  7. Aggregation (Code n8n node): Once all individual DNS lookups are complete, the Aggregate results n8n node takes all items from the batch loop. It uses custom JavaScript code to parse the raw Google API responses, extract the domain, identify records, and structure them into a single list. If a lookup returned no answer, the custom code inserts a 'NO ANSWER' placeholder for clarity in the final n8n workflow output.

Installation Guide


  1. Import: Copy the full n8n workflow JSON provided and paste it into your n8n instance using the 'New' menu > 'Import from JSON'.

  2. Activation: Ensure the n8n workflow is activated by toggling the 'Active' switch in the top right corner.

  3. Trigger Setup: This workflow uses a built-in Form input n8n trigger, which does not require external credentials.

  4. Execution: Run the n8n workflow manually or access the generated webhook URL (visible when you edit the Form input n8n trigger node) to input the domain and record types.

  5. Customization: If you need to add or remove default DNS types, modify the list found within the Default to all DNS types n8n node and the Form input n8n trigger node's options.

Node Details

Form input (n8n trigger): The starting point, acting as the primary n8n trigger. It collects the target Domain (required) and an optional multi-select field for Types (leave empty to use all).
If no DNS type in input (If n8n node): Implements flow control logic. It checks if the input array for 'Types' is empty, directing the flow to use defaults or user-selected values.
Default to all DNS types (Set n8n node): Used when no types are specified. It sets a structured JSON item containing the domain and an array of default types: ["A", "CNAME", "AAAA", "MX", "TXT", "NS"].
Split Out (n8n node): A core n8n node for data processing. It transforms the single input item containing the 'Types' array into multiple output items, one for each DNS type, facilitating parallel processing.
DNS Lookup (HTTP Request n8n node): The primary external communication n8n node. It sends a request to https://dns.google/resolve using the expression ={{ $json.Domain }} for the name and ={{ $json.Types }} for the type.
Set human readable type in output (Code n8n node): A utility n8n node that accesses the data from the upstream For each DNS type split point to ensure the current record type is tagged onto the API response data, which is crucial for proper final organization.


  • Aggregate results (Code n8n node): The final processing n8n node. It loops through all results, extracts the domain and answer data, and structures it into a concise output array, including the necessary handling for 'NO ANSWER' cases.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by

AI & Automation consultant with many years of experience from both devops and business management. A solid combination to really understand where technology can create real business value. My focus is to help businesses in Sweden work smarter and achieve more by applying technology in a useful and responsible way. Feel free to contact me at [email protected] or schedule a short call at https://smultronstudio.com

Featured*