Skip to main content

/etc/hosts provider for octoDNS

An octoDNS provider that creates a "best effort" static/emergency content that can be used in /etc/hosts to resolve things. A, AAAA records are supported and ALIAS and CNAME records will be included when they can be mapped within the zone.

Installation

Command line

pip install octodns-etchosts

requirements.txt/setup.py

Pinning specific versions or SHAs is recommended to avoid unplanned upgrades.

Versions
# Start with the latest versions and don't just copy what's here
octodns==0.9.14
octodns-etchosts==0.0.1
SHAs
# Start with the latest/specific versions and don't just copy what's here
-e git+https://git@github.com/octodns/octodns.git@9da19749e28f68407a1c246dfdf65663cdc1c422#egg=octodns
-e git+https://git@github.com/octodns/octodns-etchosts.git@ec9661f8b335241ae4746eea467a8509205e6a30#egg=octodns_etchosts

Configuration

providers:
  etchosts:
    class: octodns_etchosts.EtcHostsProvider
    # The output directory for the hosts file <zone>.hosts
    directory: ./hosts
    # Remove trailing dots of zone names (e.g. example.com. => example.com) (optional)
    # Avoids problems with certain DNS providers, as the host file format requires an alphanumeric character to be the final character in a hostname.
    # Default: True
    #remove_trailing_dots: True

Support Information

Records

EtcHostsProvider supports A and AAAA, and has partial support for tracing ALIAS and CNAME records when they can be resolved within the zone.

Dynamic

EtcHostsProvider does not support dynamic records.

Development

See the /script/ directory for some tools to help with the development process. They generally follow the Script to rule them all pattern. Most useful is ./script/bootstrap which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.

Metadata

Release files for octodns-etchosts 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for octodns-etchosts 1.1.0
File Size Uploaded
octodns_etchosts-1.1.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for octodns-etchosts 1.1.0
File Interpreter ABI Platform
octodns_etchosts-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / octodns_etchosts-1.1.0.tar.gz

Download URL octodns_etchosts-1.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6522f1abeb20e69ba8dfed716ff0e1e63b957f6dc7d584d16bc83e411560bf9d
BLAKE2b-256 checksum
How to use checksums
f9e8c2bed17cc6980f500880b731ea0c76921d48c2515c1c44498d96af410f01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / octodns_etchosts-1.1.0-py3-none-any.whl

Download URL octodns_etchosts-1.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0252cccbee35a449d21fa283b47518d5888146d357c966918b11c567a8fbeb37
BLAKE2b-256 checksum
How to use checksums
c24e7c9756279a3493ac886bac811ca0411e1bb70a77aec4d78fac00e54d26f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page