Skip to main content

CLI tool for searching PowerDNS zone listings

Project description

PDNS Zone Search

pipeline status coverage report

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 for
  • TYPE: The DNS record type (supported types: A, PTR)

Examples

  1. Find all the A records for "www.example.com":
    pdnsutil list-zone example.com | pdns-zone-search www.example.com A
    
  2. 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-zone into 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

  1. The tool reads zone data from standard input
  2. It parses the zone data into a structured format
  3. It filters records based on the provided name and type
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdns_zone_search-1.0.25.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdns_zone_search-1.0.25-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file pdns_zone_search-1.0.25.tar.gz.

File metadata

  • Download URL: pdns_zone_search-1.0.25.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for pdns_zone_search-1.0.25.tar.gz
Algorithm Hash digest
SHA256 d4c91f5df979779aa7dd5be0a249026ac5dc14488a5c27227e4fef51a3f7e9fd
MD5 91f2457287a693b1bcdd8ff44c391c4f
BLAKE2b-256 baab27f16cf435d6a1c0e3b8888f18315ce991fb64912a7afc4a8a0c1baf2756

See more details on using hashes here.

File details

Details for the file pdns_zone_search-1.0.25-py3-none-any.whl.

File metadata

File hashes

Hashes for pdns_zone_search-1.0.25-py3-none-any.whl
Algorithm Hash digest
SHA256 dd791dcd25d61d66db90a47441be1f0d952bcc43a2c1ac1df50419bf8c8b80f8
MD5 79e5a14f1c47f0e55eea626ba6114e01
BLAKE2b-256 eca044941654b20ed073f118055bdd28f0557d25ac7c14f3d0c3faae3d18d371

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page