Skip to main content

a simple DNS-over-HTTPS client

Project description


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).


pip3 install doh-cli


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 .


doh-cli A


doh-cli --help

Supported Resource Records

  • A
  • AAAA

Supported DoH Servers

Some Examples

  • IPv4

    doh-cli A

[{"Query": "", "TTL": "366", "RR": "A", "Answer": ""}]

you can use jq to format, parse output:

doh-cli A | jq .
    "Query": "",
    "TTL": "54",
    "RR": "A",
    "Answer": ""
  • IPv6

    doh-cli AAAA | jq .

    "Query": "",
    "TTL": "207",
    "RR": "AAAA",
    "Answer": "2a01:4f8:c2c:52bf::1"

    doh-cli CNAME | jq .

    "Query": "",
    "TTL": "600",
    "RR": "CNAME",
    "Answer": ""
  • Plain Output

    doh-cli A --output plain
  • debug

    doh-cli A --output plain --debug
  • Change DNS server

    doh-cli A --output plain --dns cloudflare

or you can use LibreDNS Block Trackers endpoint:

doh-cli --output plain --dns libredns-ads A

Project details

Release history Release notifications

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for doh-cli, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size doh_cli-0.1-py3-none-any.whl (15.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size doh-cli-0.1.tar.gz (15.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page