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.24.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.24-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdns_zone_search-1.0.24.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.24.tar.gz
Algorithm Hash digest
SHA256 0c86e4d1f9047e03ef78ec096a09c26df5a7ffd9e6ebdf0494118f5f95e0a1ce
MD5 1c23f3c81a98901836600d52a29594e1
BLAKE2b-256 168e7a6b4f86f5600a49b727a2b8f6f8cab4e502adb3775daa363846ae166e96

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pdns_zone_search-1.0.24-py3-none-any.whl
Algorithm Hash digest
SHA256 31889a6ecacb4cc2ef7fd14c434c5dc7cc46beafafb46ca606dc9c036e51e396
MD5 5687682a01f3ee18a8d8e3f1c7e4a7a3
BLAKE2b-256 4ae744c5f091eb61b1567bac2d1b2c4a6395af1ce4695fca4eef2c2353f448c0

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