Skip to main content

Simple python3 DNS server

Project description

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"

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

dns_local-2.1.2.tar.gz (20.3 kB view hashes)

Uploaded Source

Built Distribution

dns_local-2.1.2-py3-none-any.whl (18.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page