CLI tool for searching PowerDNS zone listings
Project description
PDNS Zone Search
A lightweight CLI tool for searching PowerDNS zone listings and extracting matching record sets as structured JSON.
Overview
PDNS Zone Search is designed to simplify searching through PowerDNS zone files by providing a simple command-line
interface to extract and filter DNS records. It takes the output from pdnsutil list-zone commands, parses it
into structured data, and allows filtering by record name, type, and optionally by record data.
Installation
pip install pdns-zone-search
Usage
The tool is designed to be used in a pipeline with pdnsutil, reading zone data from standard input:
pdnsutil list-zone example.com | pdns-zone-search example.com A
Command Line Options
pdns-zone-search NAME TYPE
NAME: The DNS record name to search forTYPE: The DNS record type (supported types: A, PTR)
Examples
- Find all the A records for "www.example.com":
pdnsutil list-zone example.com | pdns-zone-search www.example.com A
- Find all the PTR records for "server.example.com" (searches the data field of the zone):
pdnsutil list-zone 1.168.192.in-addr.arpa | pdns-zone-search server.example.com PTR
Output Format
The tool outputs JSON-formatted data for easy parsing in scripts:
[
[
"proxmox.demo.example.com",
"3600",
"IN",
"A",
"10.0.0.100"
],
[
"proxmox.demo.example.com",
"3600",
"IN",
"A",
"10.0.0.100"
],
[
"proxmox.demo.example.com",
"3600",
"IN",
"A",
"10.0.0.107"
]
]
For record sets with multiple entries (like multiple A records for load balancing), all matching records are returned in the array.
Features
- Parses the output of
pdnsutil list-zoneinto structured data - Filters records by name
- Returns full record sets (all records of the same name and type)
- JSON output for easy integration with other tools and scripts
How It Works
- The tool reads zone data from standard input
- It parses the zone data into a structured format
- It filters records based on the provided name and type
- It returns the matching record set as JSON
License
This project is licensed under the MIT License, see the LICENSE file in the root directory for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdns_zone_search-1.0.6.tar.gz.
File metadata
- Download URL: pdns_zone_search-1.0.6.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
015da97206e23b632d956c0d3c942dbb110fe0db1768c8fc60a4d15ab3d7e41d
|
|
| MD5 |
1afbd9784d6ebda2bebc78390dd861b6
|
|
| BLAKE2b-256 |
5492b72528eff25c806a6cd031c02051ae271c03ac12b0cd378c0c16ef1307e1
|
File details
Details for the file pdns_zone_search-1.0.6-py3-none-any.whl.
File metadata
- Download URL: pdns_zone_search-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b43fa9dc2b6e53e8244560084f64bb8c9cb79b2e3c8d937a3bda851ded60cebf
|
|
| MD5 |
37cc7b3625db77a2fb106eda4cf2cb51
|
|
| BLAKE2b-256 |
ddce6283149bb1456b20c51ac98b3a65654fb139c3048f3ef33ca07c6e7a6f47
|