{"id":21464233,"url":"https://github.com/shuque/zonequery","last_synced_at":"2025-07-13T20:34:49.321Z","repository":{"id":143298492,"uuid":"331474386","full_name":"shuque/zonequery","owner":"shuque","description":"Query all DNS authoritative servers","archived":false,"fork":false,"pushed_at":"2025-05-24T04:01:05.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-24T05:18:17.384Z","etag":null,"topics":["dns","query","zone"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shuque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-01-21T00:57:18.000Z","updated_at":"2025-05-24T04:00:43.000Z","dependencies_parsed_at":"2025-05-26T10:17:13.866Z","dependency_job_id":null,"html_url":"https://github.com/shuque/zonequery","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/shuque/zonequery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuque%2Fzonequery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuque%2Fzonequery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuque%2Fzonequery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuque%2Fzonequery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shuque","download_url":"https://codeload.github.com/shuque/zonequery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shuque%2Fzonequery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265200353,"owners_count":23726820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dns","query","zone"],"created_at":"2024-11-23T07:30:27.471Z","updated_at":"2025-07-13T20:34:49.307Z","avatar_url":"https://github.com/shuque.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zonequery\nQuery all DNS authoritative servers at a zone\n\nScript to query all the authoritative servers for a zone, for a given\nquery name and type. The default output is a detailed machine parseable\nJSON string. The --text option can be used to produce an abbreviated\ntext based output.\n\nThis program can also be invoked as an AWS lambda function via the\nlambda_handler() function.\n\nAuthor: Shumon Huque\n\n## Pre-requisites\n\n* Python3\n* Additional modules:\n  * dnspython\n  * sortedcontainers\n\n## Installation\n\nTo install from a local copy of this repository:\n\n```\npip3 install .\n```\n\nTo install from the git repo directly:\n\n```\npip3 install git+https://github.com/shuque/zonequery.git@v0.3.3\n```\n\n## Usage\n\n```\n$ zonequery.py -h\nusage: zonequery.py [-h] [-v] [-4 | -6] [--bufsize N] [--noedns] [--nsid]\n                    [--subnet SUBNET] [--dnssec] [--text] [--timeout N]\n                    [--retries N] [--notcpfallback] [--tcp] [--section name]\n                    zone qname qtype\n\nVersion 0.3.3\nQuery all nameserver addresses for a given zone, qname, and qtype.\n\npositional arguments:\n  zone             DNS zone name\n  qname            Query name\n  qtype            Query type\n\noptional arguments:\n  -h, --help       show this help message and exit\n  -v, --verbose    increase output verbosity\n  -4               Use IPv4 transport only\n  -6               Use IPv6 transport only\n  --bufsize N      Set EDNS buffer size in octets (default: 1420)\n  --noedns         Don't use EDNS\n  --nsid           Send NSID EDNS option\n  --subnet SUBNET  EDNS Client Subnet (e.g. 1.2.3.4/24)\n  --dnssec         Set DNSSEC-OK bit in queries\n  --text           Emit abbreviated text output (default is json)\n  --timeout N      Query timeout in secs (default: 3)\n  --retries N      Number of UDP retries (default: 2)\n  --notcpfallback  Do not fall back to TCP on truncation\n  --tcp            Use TCP only (default: UDP with TCP fallback)\n  --section name   Specify response section to display (default: all)\n```\n\n## Example output\n\n```\n$ zonequery.py google.com www.google.com A\n\n{\n  \"timestamp\": 1653357383.3894224,\n  \"query\": {\n    \"zone\": \"google.com\",\n    \"qname\": \"www.google.com\",\n    \"qtype\": \"A\",\n    \"edns_buf_size\": 1420\n  },\n  \"nslist\": {\n    \"ns1.google.com.\": [\n      \"2001:4860:4802:32::a\",\n      \"216.239.32.10\"\n    ],\n    \"ns2.google.com.\": [\n      \"2001:4860:4802:34::a\",\n      \"216.239.34.10\"\n    ],\n    \"ns3.google.com.\": [\n      \"2001:4860:4802:36::a\",\n      \"216.239.36.10\"\n    ],\n    \"ns4.google.com.\": [\n      \"2001:4860:4802:38::a\",\n      \"216.239.38.10\"\n    ]\n  },\n  \"responses\": [\n    {\n      \"name\": \"ns1.google.com.\",\n      \"ip\": \"2001:4860:4802:32::a\",\n      \"size\": 59,\n      \"rtt\": 8.591,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 4625,\n      \"short_answers\": \"142.250.65.164\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.250.65.164\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns1.google.com.\",\n      \"ip\": \"216.239.32.10\",\n      \"size\": 59,\n      \"rtt\": 8.449,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 40003,\n      \"short_answers\": \"142.251.40.228\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.251.40.228\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns2.google.com.\",\n      \"ip\": \"2001:4860:4802:34::a\",\n      \"size\": 59,\n      \"rtt\": 15.182,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 32438,\n      \"short_answers\": \"142.250.65.164\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.250.65.164\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns2.google.com.\",\n      \"ip\": \"216.239.34.10\",\n      \"size\": 59,\n      \"rtt\": 15.129,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 7611,\n      \"short_answers\": \"142.251.40.228\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.251.40.228\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns3.google.com.\",\n      \"ip\": \"2001:4860:4802:36::a\",\n      \"size\": 59,\n      \"rtt\": 14.638,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 57517,\n      \"short_answers\": \"142.250.65.164\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.250.65.164\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns3.google.com.\",\n      \"ip\": \"216.239.36.10\",\n      \"size\": 59,\n      \"rtt\": 15.393,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 24607,\n      \"short_answers\": \"142.251.40.228\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.251.40.228\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns4.google.com.\",\n      \"ip\": \"2001:4860:4802:38::a\",\n      \"size\": 59,\n      \"rtt\": 8.974,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 44152,\n      \"short_answers\": \"142.250.65.164\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.250.65.164\"\n            ]\n          }\n        ]\n      }\n    },\n    {\n      \"name\": \"ns4.google.com.\",\n      \"ip\": \"216.239.38.10\",\n      \"size\": 59,\n      \"rtt\": 8.613,\n      \"rcode\": \"NOERROR\",\n      \"flags\": \"QR AA\",\n      \"id\": 34167,\n      \"short_answers\": \"142.251.40.228\",\n      \"sections\": {\n        \"answer\": [\n          {\n            \"rrname\": \"www.google.com.\",\n            \"rrtype\": \"A\",\n            \"ttl\": 300,\n            \"rdata\": [\n              \"142.251.40.228\"\n            ]\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\nAre all the salesforce.com/A answer sets the same?\n\n```\n$ zonequery.py salesforce.com salesforce.com A | jq -r '.responses[].short_answers'\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n104.109.10.129,104.109.11.129,184.25.179.132,184.31.10.133,184.31.3.130,23.1.106.133,23.1.35.132,23.1.99.130\n\n$ zonequery.py salesforce.com salesforce.com A | jq -r '.responses[].short_answers' | sort -u | wc -l\n1\n\nYES.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuque%2Fzonequery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuque%2Fzonequery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuque%2Fzonequery/lists"}