Skip to main content

Python application Pypi version

Description

Simple python3 DNS server

Installation

python3 -m pip install dns_local

Or directly from sources:

git clone git@github.com:doronz88/dns_local.git
cd dns_local
python3 -m pip install -e .

Usage

Usage: python -m dns_local [OPTIONS]

  Start a DNS implemented in Python

Options:
  --bind TEXT      bind address
  --tcp            enable TCP server
  --udp            enable UDP server
  --domain TEXT    domain reply (e.g. example\\.com:127.0.0.1)
  --fallback TEXT  fallback dns server (e.g. 8.8.8.8)
  --help           Show this message and exit.

For example, consider the following usage:

python3 -m dns_local --bind 192.168.2.1:53 --udp --fallback 8.8.8.8 --domain kaki:192.168.2.1 --domain kaki2:192.168.2.1

This will start a udp DNS server listening at 192.168.2.1:53 with the two entries:

  • kaki1 -> 192.168.2.1
  • kaki2 -> 192.168.2.1

And use Google's DNS server (8.8.8.8) as a fallback for any entry not in given domain list.

Domains also support regex patterns. For example, the following will forward all domains to 127.0.0.1, except for google.com which will be forwarded to 8.8.8.8:

python3 -m dns_local --bind 192.168.2.1:53 --udp --domain "google\\.com:8.8.8.8" --domain ".*:127.0.0.1"

Metadata

Release files for dns-local 2.1.2

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

Source distribution (sdist)

Source distribution for dns-local 2.1.2
File Size Uploaded
dns_local-2.1.2.tar.gz 20.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dns-local 2.1.2
File Interpreter ABI Platform
dns_local-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / dns_local-2.1.2.tar.gz

Download URL dns_local-2.1.2.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9c0197cd4170a560ede719f34d21ff76f7249de90eeef283be841b58d195c76e
BLAKE2b-256 checksum
How to use checksums
deb3dc88d6798bce92162c630850103ee1d64645cd8c9c0fe0b61959757ab238
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / dns_local-2.1.2-py3-none-any.whl

Download URL dns_local-2.1.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b00fa9a1672fbd3339e5e1fddd45372a68d44af8b196f1854e9848df91824df4
BLAKE2b-256 checksum
How to use checksums
6f09f20ce333e63648f0959ad12c1bfb11ddf1337ba1de2adddcdac6932af56a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.0.0

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