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.6.tar.gz (10.8 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.6-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for pdns_zone_search-1.0.6.tar.gz
Algorithm Hash digest
SHA256 015da97206e23b632d956c0d3c942dbb110fe0db1768c8fc60a4d15ab3d7e41d
MD5 1afbd9784d6ebda2bebc78390dd861b6
BLAKE2b-256 5492b72528eff25c806a6cd031c02051ae271c03ac12b0cd378c0c16ef1307e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pdns_zone_search-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b43fa9dc2b6e53e8244560084f64bb8c9cb79b2e3c8d937a3bda851ded60cebf
MD5 37cc7b3625db77a2fb106eda4cf2cb51
BLAKE2b-256 ddce6283149bb1456b20c51ac98b3a65654fb139c3048f3ef33ca07c6e7a6f47

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