[![Python application](https://github.com/doronz88/dns_local/workflows/Python%20application/badge.svg)](https://github.com/doronz88/dns_local/actions/workflows/python-app.yml "Python application action")
[![Pypi version](https://img.shields.io/pypi/v/dns_local.svg)](https://pypi.org/project/dns_local/ "PyPi package")
# Description
Simple python3 DNS server
# Installation
```shell
python3 -m pip install dns_local
```
Or directly from sources:
```shell
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:
```shell
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:
```shell
python3 -m dns_local --bind 192.168.2.1:53 --udp --domain "google\\.com:8.8.8.8" --domain ".*:127.0.0.1"
```
Raw data
{
"_id": null,
"home_page": "",
"name": "dns-local",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "doronz88 <doron88@gmail.com>",
"keywords": "dns,protocol",
"author": "",
"author_email": "doronz88 <doron88@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/de/b3/dc88d6798bce92162c630850103ee1d64645cd8c9c0fe0b61959757ab238/dns_local-2.1.2.tar.gz",
"platform": null,
"description": "[![Python application](https://github.com/doronz88/dns_local/workflows/Python%20application/badge.svg)](https://github.com/doronz88/dns_local/actions/workflows/python-app.yml \"Python application action\")\n[![Pypi version](https://img.shields.io/pypi/v/dns_local.svg)](https://pypi.org/project/dns_local/ \"PyPi package\")\n\n# Description\n\nSimple python3 DNS server\n\n# Installation\n\n```shell\npython3 -m pip install dns_local\n```\n\nOr directly from sources:\n\n```shell\ngit clone git@github.com:doronz88/dns_local.git\ncd dns_local\npython3 -m pip install -e .\n```\n\n# Usage\n\n```\nUsage: python -m dns_local [OPTIONS]\n\n Start a DNS implemented in Python\n\nOptions:\n --bind TEXT bind address\n --tcp enable TCP server\n --udp enable UDP server\n --domain TEXT domain reply (e.g. example\\\\.com:127.0.0.1)\n --fallback TEXT fallback dns server (e.g. 8.8.8.8)\n --help Show this message and exit.\n```\n\nFor example, consider the following usage:\n\n```shell\npython3 -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\n```\n\nThis will start a `udp` DNS server listening at `192.168.2.1:53` with the two entries:\n\n- `kaki1` -> `192.168.2.1`\n- `kaki2` -> `192.168.2.1`\n\nAnd use Google's DNS server (`8.8.8.8`) as a fallback for any entry not in given domain list.\n\nDomains 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:\n\n```shell\npython3 -m dns_local --bind 192.168.2.1:53 --udp --domain \"google\\\\.com:8.8.8.8\" --domain \".*:127.0.0.1\"\n```\n",
"bugtrack_url": null,
"license": "GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007",
"summary": "Simple python3 DNS server",
"version": "2.1.2",
"project_urls": {
"Bug Reports": "https://github.com/doronz88/dns_local/issues",
"Homepage": "https://github.com/doronz88/dns_local"
},
"split_keywords": [
"dns",
"protocol"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6f09f20ce333e63648f0959ad12c1bfb11ddf1337ba1de2adddcdac6932af56a",
"md5": "0bfd157aae533e8b14f75b58b2291f0d",
"sha256": "b00fa9a1672fbd3339e5e1fddd45372a68d44af8b196f1854e9848df91824df4"
},
"downloads": -1,
"filename": "dns_local-2.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0bfd157aae533e8b14f75b58b2291f0d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18342,
"upload_time": "2024-02-20T15:12:37",
"upload_time_iso_8601": "2024-02-20T15:12:37.325727Z",
"url": "https://files.pythonhosted.org/packages/6f/09/f20ce333e63648f0959ad12c1bfb11ddf1337ba1de2adddcdac6932af56a/dns_local-2.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "deb3dc88d6798bce92162c630850103ee1d64645cd8c9c0fe0b61959757ab238",
"md5": "36442e099e08ea1913cbb7d283d3bb49",
"sha256": "9c0197cd4170a560ede719f34d21ff76f7249de90eeef283be841b58d195c76e"
},
"downloads": -1,
"filename": "dns_local-2.1.2.tar.gz",
"has_sig": false,
"md5_digest": "36442e099e08ea1913cbb7d283d3bb49",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 20273,
"upload_time": "2024-02-20T15:12:38",
"upload_time_iso_8601": "2024-02-20T15:12:38.942388Z",
"url": "https://files.pythonhosted.org/packages/de/b3/dc88d6798bce92162c630850103ee1d64645cd8c9c0fe0b61959757ab238/dns_local-2.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-20 15:12:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "doronz88",
"github_project": "dns_local",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "dns-local"
}