Tool for lookup lots of DNS records from multiple nameservers.
Can be used for:
- DNS troubleshooting in complex infrastructures with multiple nameservers
- Troubleshooting different queries results from different networks
- DNS records inventory
- DNS records monitoring
Currently supported output formats:
- JSON
- Pretty JSON
- YAML
- CSV
sequenceDiagram
activate dns-checker.sh
dns-checker.sh->>1.1.1.1: mail.google.com A?
activate 1.1.1.1
1.1.1.1-->>dns-checker.sh: 142.250.185.101
deactivate 1.1.1.1
dns-checker.sh->>1.1.1.1: meet.google.com A?
activate 1.1.1.1
1.1.1.1-->>dns-checker.sh: 142.250.186.78
deactivate 1.1.1.1
dns-checker.sh->>8.8.8.8: mail.google.com A?
activate 8.8.8.8
8.8.8.8-->>dns-checker.sh: 173.194.73.83
deactivate 8.8.8.8
dns-checker.sh->>8.8.8.8: meet.google.com A?
activate 8.8.8.8
8.8.8.8-->>dns-checker.sh: 173.194.221.113
deactivate 8.8.8.8
dns-checker.sh->>1.1.1.1: google.com MX?
activate 1.1.1.1
1.1.1.1-->>dns-checker.sh: 10 smtp.google.com.
deactivate 1.1.1.1
dns-checker.sh->>8.8.8.8: google.com MX?
activate 8.8.8.8
8.8.8.8-->>dns-checker.sh: 10 smtp.google.com.
deactivate 8.8.8.8
dns-checker.sh-)Json or yaml output: Aggregated DNS lookup results
deactivate dns-checker.sh
Required utilities:
- jq
- dig
- grep
- date
- sed
Optional utilities:
- yq - if YAML format used
- Clone repository.
- Create
config.json
orconfig.yaml
configuration files. See the format below. chmod +x dns-checker.sh
- Execute
dns-checker.sh
Configuration file should be named config.json
or config.yaml
.
Default input is config.json
, then try config.yaml
.
Parameter | Required | Value | Exaple |
---|---|---|---|
.datetime_format |
No | Date format in linux date command syntax. Dafault is --iso-8601=seconds |
"datetime_format": "-u --iso-8601=seconds" |
.output |
No | Allowed values: json , pretty_json , yaml , csv , html . Default is json . |
"output": "json" |
.nameservers[] |
Yes | List of nameservers | "nameservers": ["8.8.8.8","1.1.1.1"] |
.lookup[] |
Yes | List of dicts | "lookup": [{"zone": "google.com","domains": ["mail","meet"]}] |
.lookup[].type |
No | Type of DNS record. Default is A . |
"type": "MX" |
.lookup[].zone |
No | DNS zone. No default value. | "zone": "google.com" |
.lookup[].domains[] |
Yes | List of domains to lookup | "lookup": [{"domains": ["mail.google.com","meet.google.com"]}] |
YAML example:
---
datetime_format: -u --iso-8601=seconds # Date format. Optional.
output: json # Values: json, pretty_json, yaml, csv, html. Default is json. Optional.
nameservers: # List of nameservers. Required.
- 8.8.8.8
- 1.1.1.1
lookup: # List of records. Required.
- type: A # Record type. Default is A. Optional.
zone: com # Zone. Optional.
domains: # List of domains of specified zones. Required.
- google
- www.example
- type: MX # Record type. Default is A. Optional.
domains: # List of domains in FQDN format (no zone specified). Required.
- google.com
- example.com
JSON example:
{
"datetime_format": "-u --iso-8601=seconds",
"output": "json",
"nameservers": [
"8.8.8.8",
"1.1.1.1"
],
"lookup": [
{
"type": "A",
"zone": "com",
"domains": [
"google",
"www.example"
]
},
{
"type": "MX",
"domains": [
"google.com",
"example.com"
]
}
]
}
Configuration:
{
"datetime_format": "-u --iso-8601=seconds",
"output": "pretty_json",
"nameservers": [
"8.8.8.8",
"1.1.1.1"
],
"lookup": [
{
"zone": "google.com",
"domains": [
"mail",
"meet"
]
}
]
}
Run script:
chmod +x dns-checker.sh && ./dns-checker.sh
Output:
{
"data": [
{
"datetime": "2025-06-11T18:36:55+00:00",
"nameserver": "8.8.8.8",
"zone": ".google.com",
"domain": "mail",
"fqdn": "mail.google.com",
"type": "A",
"lookup": [
"216.58.211.5"
]
},
{
"datetime": "2025-06-11T18:36:55+00:00",
"nameserver": "8.8.8.8",
"zone": ".google.com",
"domain": "meet",
"fqdn": "meet.google.com",
"type": "A",
"lookup": [
"142.250.74.174"
]
},
{
"datetime": "2025-06-11T18:36:55+00:00",
"nameserver": "1.1.1.1",
"zone": ".google.com",
"domain": "mail",
"fqdn": "mail.google.com",
"type": "A",
"lookup": [
"142.250.185.229"
]
},
{
"datetime": "2025-06-11T18:36:55+00:00",
"nameserver": "1.1.1.1",
"zone": ".google.com",
"domain": "meet",
"fqdn": "meet.google.com",
"type": "A",
"lookup": [
"142.250.185.206"
]
}
],
"errors": []
}