Skip to main content

zero-dependency DNS over HTTPS resolver for Python, with an optional socket.getaddrinfo patch

Project description

pydoh

CI Coverage pypi downloads versions license

DNS-over-HTTPS резолвер для питона. ноль зависимостей — весь HTTPS через стандартный http.client+ssl. провайдер/DPI видит только твой HTTPS к cloudflare, а не голые DNS-запросы.

sequenceDiagram
    App->>pydoh: resolve("example.com")
    pydoh->>Cloudflare: DNS-запрос внутри HTTPS POST
    Cloudflare-->>pydoh: ответ внутри HTTPS
    pydoh-->>App: ["93.184.216.34"]

установка

pip install pydoh

юзать

import pydoh

ips = pydoh.resolve("example.com")

или подменить резолвинг вообще везде в питоне одной строкой — requests, aiohttp, что угодно на сокетах будет резолвить через DoH:

import pydoh
pydoh.patch_socket()

фичи

  • zero deps, только stdlib
  • fallback между cloudflare / google / quad9 если один упал
  • кэш по TTL из ответа
  • typed (py.typed), питон 3.10–3.13

что не умеет

не проверяет DNSSEC, не поддерживает TCP-фрагментированные DNS-ответы больше одного UDP-пакета.

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

pydoh-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydoh-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pydoh-0.1.0.tar.gz.

File metadata

  • Download URL: pydoh-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pydoh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5138e9cae50cc36ed413ca195d35eb3064b94ad7b5a77188c0dc738180dc46ac
MD5 73fb4693903c1764fe576f1b666bab25
BLAKE2b-256 306d92edd259cbbd12249e19dcdfdb349b0bb7d40737cc948d42bda5e4a51b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoh-0.1.0.tar.gz:

Publisher: publish.yml on ImSavsis/pydoh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydoh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pydoh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pydoh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b05e49465b3aa6ac425fa80ed927b2963fecca5bde0cbcf2aa0830d6dc0289
MD5 dc83f839e322da2601eeb08cad06c9d1
BLAKE2b-256 446c6a0363ad6ad887d24b52d9f7b4dacd34e79158f6d82a089c63fb5bc94e14

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoh-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ImSavsis/pydoh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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