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:
-
Launch the container.
docker compose up- Admin UI: http://localhost/admin
- API Docs: http://localhost/api/docs
-
Run octodns-sync against the container
octodns-sync --config-file=./example/config.yaml -
Synchronize changes with Pi-hole
octodns-sync --config-file=./example/config.yaml --doit -
View records within the admin UI: Local DNS Records
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d08c671d8c9b63a1b97ac1a8470a430a6923557016c07c3310e6aaf0c27ad777
|
|
| MD5 |
fc5cfb2e4811725ea7b6f18c80c1bb29
|
|
| BLAKE2b-256 |
0e1814779acb52012104757f66143b0c1e9144436c06742ac4a9ec297e9716ad
|
Provenance
The following attestation bundles were made for octodns_pihole-0.1.0.tar.gz:
Publisher:
publish.yaml on roosnic1/octodns-pihole
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octodns_pihole-0.1.0.tar.gz -
Subject digest:
d08c671d8c9b63a1b97ac1a8470a430a6923557016c07c3310e6aaf0c27ad777 - Sigstore transparency entry: 940536323
- Sigstore integration time:
-
Permalink:
roosnic1/octodns-pihole@657d88d8eb4ce4198ef91cd7010dcf4d2ee1d7a6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/roosnic1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@657d88d8eb4ce4198ef91cd7010dcf4d2ee1d7a6 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
920cc221f3d27a752a844302ddfe66a515d18447ed5beefcdad620e8ea90a6ea
|
|
| MD5 |
8208a87c2bcd557da3211b811eabc35a
|
|
| BLAKE2b-256 |
bd88179fb8e71c53ebc08467537857467c94748f8844671f35652abb53f3b939
|
Provenance
The following attestation bundles were made for octodns_pihole-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on roosnic1/octodns-pihole
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
octodns_pihole-0.1.0-py3-none-any.whl -
Subject digest:
920cc221f3d27a752a844302ddfe66a515d18447ed5beefcdad620e8ea90a6ea - Sigstore transparency entry: 940536338
- Sigstore integration time:
-
Permalink:
roosnic1/octodns-pihole@657d88d8eb4ce4198ef91cd7010dcf4d2ee1d7a6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/roosnic1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@657d88d8eb4ce4198ef91cd7010dcf4d2ee1d7a6 -
Trigger Event:
release
-
Statement type: