Skip to main content

Pi-hole provider for octoDNS

Project description

Pi-hole provider for octoDNS

An octoDNS provider that targets Pi-hole. Uses the pihole6api library for API communication.

Pi-hole version 6 is supported.

This provider manages matching A/AAAA/CNAME records with Pi-hole's Local DNS Records. It will manage host and CNAME entries that match domain names under management by OctoDNS. Other existing Pi-hole entries are untouched.

TTL values are unsupported on host records (A/AAAA). CNAME records support an optional TTL.

Installation

pip install octodns-pihole

Configuration

providers:
  pihole:
    class: octodns_pihole.PiholeProvider
    url: https://pihole.lan:443
    password: env/PIHOLE_PASSWORD
    strict_supports: false # ignore unsupported records

Support Information

Records

Pi-hole supports A, AAAA, and CNAME. PTR records will automatically exist for A and AAAA records.

Dynamic

PiholeProvider does not support dynamic records.

Development

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest --disable-network

# Run tests with coverage
pytest --disable-network --cov=octodns_pihole --cov-report=term-missing

# Lint
pyflakes octodns_pihole/*.py tests/*.py

# Format
isort octodns_pihole/ tests/
black octodns_pihole/ tests/

There is a docker-compose.yml file included in the repo that will set up a Pi-hole server with the API enabled for use in development. The admin password/api-key for it is correct horse battery staple.

A configuration example is provided and can be used along with the docker-compose.yml:

  1. Launch the container.

     docker compose up
    
  2. Run octodns-sync against the container

     octodns-sync --config-file=./example/config.yaml
    
  3. Synchronize changes with Pi-hole

     octodns-sync --config-file=./example/config.yaml --doit
    
  4. View records within the admin UI: Local DNS Records

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

octodns_pihole-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

octodns_pihole-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file octodns_pihole-0.1.0.tar.gz.

File metadata

  • Download URL: octodns_pihole-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for octodns_pihole-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d08c671d8c9b63a1b97ac1a8470a430a6923557016c07c3310e6aaf0c27ad777
MD5 fc5cfb2e4811725ea7b6f18c80c1bb29
BLAKE2b-256 0e1814779acb52012104757f66143b0c1e9144436c06742ac4a9ec297e9716ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for octodns_pihole-0.1.0.tar.gz:

Publisher: publish.yaml on roosnic1/octodns-pihole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file octodns_pihole-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: octodns_pihole-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for octodns_pihole-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 920cc221f3d27a752a844302ddfe66a515d18447ed5beefcdad620e8ea90a6ea
MD5 8208a87c2bcd557da3211b811eabc35a
BLAKE2b-256 bd88179fb8e71c53ebc08467537857467c94748f8844671f35652abb53f3b939

See more details on using hashes here.

Provenance

The following attestation bundles were made for octodns_pihole-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on roosnic1/octodns-pihole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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