a simple DNS-over-HTTPS client
Project description
doh-cli
a simple DNS over HTTPS client
This is a simple DoH python client (RFC 8484, GET), json output by default! In ~55 lines of code (more or less).
Install
pip3 install doh-cli
Requirements
It's based on (tested on Python 3.8.0).
If you want to contribute, you can clone the repository and install all dependencies locally:
pip3 install .
Usage
doh-cli libredns.gr A
Help
doh-cli --help
Supported Resource Records
- A
- AAAA
- CNAME
Supported DoH Servers
- https://libredns.gr
- https://dns.google
- https://cloudflare-dns.com
- https://quad9.net
- https://doh.cleanbrowsing.org
Some Examples
-
IPv4
doh-cli libredns.gr A
[{"Query": "libredns.gr.", "TTL": "366", "RR": "A", "Answer": "116.203.115.192"}]
you can use jq to format, parse output:
doh-cli libredns.gr A | jq .
[
{
"Query": "libredns.gr.",
"TTL": "54",
"RR": "A",
"Answer": "116.203.115.192"
}
]
-
IPv6
doh-cli libredns.gr AAAA | jq .
[
{
"Query": "libredns.gr.",
"TTL": "207",
"RR": "AAAA",
"Answer": "2a01:4f8:c2c:52bf::1"
}
]
-
CNAME
doh-cli www.libredns.gr CNAME | jq .
[
{
"Query": "www.libredns.gr.",
"TTL": "600",
"RR": "CNAME",
"Answer": "libredns.gr."
}
]
-
Plain Output
doh-cli libredns.gr A --output plain
116.203.115.192
-
debug
doh-cli libredns.gr A --output plain --debug
https://doh.libredns.gr/dns-query?dns=lSIBAAABAAAAAAAACGxpYnJlZG5zAmdyAAABAAE
116.203.115.192
-
Change DNS server
doh-cli libredns.gr A --output plain --dns cloudflare
116.203.115.192
or you can use LibreDNS Block Trackers endpoint:
doh-cli --output plain --dns libredns-ads analytics.google.com A
0.0.0.0
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
Built Distribution
File details
Details for the file doh-cli-0.1.tar.gz
.
File metadata
- Download URL: doh-cli-0.1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56480c36745c8464edee8003cbb926f97985b3aacb158683a3e8c00a00539251 |
|
MD5 | cd70965127111e35475e236979fcaecd |
|
BLAKE2b-256 | 565d7e45d17ccdd00edf23785316b0fe48e2ad0711c0832771c089d3ef4a5619 |
File details
Details for the file doh_cli-0.1-py3-none-any.whl
.
File metadata
- Download URL: doh_cli-0.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e641f1cbb926b417fda4d0866deca5cba529cb963c871d9cc9a6d46fbc8ec9d |
|
MD5 | a7fe13137ca3015643e7b67cd75f0837 |
|
BLAKE2b-256 | fc34e4386d4ecd5ce665e09e0c283d31461e02a758da8f2fbda55c2456937e7a |