Skip to main content

DNS, email, and web security hygiene SDK and CLI for DevOps and security engineers.

Project description

dnsight

Testing CI codecov Quality Gate
Package PyPI Python Downloads
Meta License: MIT Docs
Stack uv Ruff just SonarCloud Aikido

dnsight is a Python SDK and CLI for auditing DNS, email authentication (SPF, DKIM, DMARC), and related signals. Use it from the shell or import it in your own tooling.

Python: supports 3.11+. If you’re working on the project or want to match what maintainers run day to day, use 3.14 (that’s also what our default CI setup targets). We test against 3.11 through 3.14.

Install

Same package gives you both the dnsight command and the importable API. Install however you like:

pip install dnsight
uv add dnsight                    # in a project
uv tool install dnsight             # standalone tool env
pipx install dnsight              # optional: isolated CLI app

Quickstart (CLI)

dnsight --help
dnsight audit example.com
dnsight config example > dnsight.yaml
dnsight dmarc generate

Global flags (e.g. output format) are on the root command—try dnsight --help for options like --format.

Logging (CLI)

Diagnostics go to stderr via the dnsight logger, using Rich (level colours, optional paths and tracebacks). Audit results on stdout are unchanged by --quiet; quiet only raises the log threshold so INFO/DEBUG lines disappear.

Flag Effect
(default) INFO logs, compact lines (message · logger.name)
--quiet / -q ERROR only on stderr
--verbose / -v DEBUG, show call paths, Rich tracebacks on errors

If both --quiet and --verbose are passed, --quiet wins.

Library use: call configure() from dnsight.core when you want visible logs. Keyword options include detailed_log=True (include file/line in plain mode or path column in Rich mode), use_rich=True for coloured output, rich_tracebacks=True for exception formatting, and format_string=... for a fully custom logging.Formatter layout (this forces a plain stderr stream handler).

Commands

Besides version, docs (prints the documentation site URL), audit, and config, there’s a group per check: caa, dkim, dmarc, dnssec, headers, mx, spf. Pass domains (or rely on manifest mode from config) to run the check; some groups add a generate subcommand for record output. See dnsight --help and dnsight <cmd> --help for the exact shape.

Output formats

-f / --format accepts rich (default), json, sarif, or markdown. Use -o / --output to write to a file instead of stdout.

Shell completion

Typer can emit completion scripts: dnsight --install-completion (and --show-completion if you just want to inspect). If you’re hacking on the repo, tools/dnsight-completion.zsh is a tiny helper for zsh.

SDK

from dnsight import run_check_sync, run_domain_sync

audit = run_domain_sync("example.com")
print(audit.critical_count, audit.partial)

dmarc = run_check_sync("dmarc", "example.com")
print(dmarc.passed, len(dmarc.issues))

Hacking on dnsight

You’ll want uv (we expect at least 0.10.7) and just. Python 3.14 is the comfortable default for local work.

just install       # editable install + dev deps
just pre-install   # pre-commit hooks
just check && just test

Ruff, mypy, and friends come from the dev dependency group—you don’t need to install them globally. Process and expectations: CONTRIBUTING.md. Architecture notes for agents and contributors: AGENTS.md.

Documentation

The MkDocs site (configuration guide, CLI reference, API stubs) is built from docs/ and published to GitHub Pages on pushes to main (workflow). The public URL is https://dnsight.github.io/dnsight/ (see site_url in mkdocs.yml). The repository must use Settings → Pages → Source: GitHub Actions the first time you enable hosting.

Preview locally: install the docs dependency group, then serve (live reload on edits):

uv sync --group docs    # or: just install  # includes all groups
just docs-serve         # http://127.0.0.1:8000

Use just docs-build for a strict production-like build. After changing the CLI tree, run just docs-generate and commit everything under docs/cli/; the Documentation job in CI checks that tree stays in sync and runs mkdocs build --strict.

This README, AGENTS.md, and the code remain the day-to-day sources of truth for behaviour; the site summarises and links outward where useful.

Contributing

See CONTRIBUTING.md for setup, conventional commits, and release notes. Releases: GitHub Releases. Security: SECURITY.md.

License

MIT

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

dnsight-1.0.0.tar.gz (328.2 kB view details)

Uploaded Source

Built Distribution

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

dnsight-1.0.0-py3-none-any.whl (185.7 kB view details)

Uploaded Python 3

File details

Details for the file dnsight-1.0.0.tar.gz.

File metadata

  • Download URL: dnsight-1.0.0.tar.gz
  • Upload date:
  • Size: 328.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dnsight-1.0.0.tar.gz
Algorithm Hash digest
SHA256 008a32a143f6607e4901e6c26dcb154de53076852a20373e915dfff87e51b153
MD5 4bf292181ea4695fc71f6c03222eb79f
BLAKE2b-256 9cd6c46b5940092bc6a070e543c36806a87c1764b8a14d2bad3b272c59c70b25

See more details on using hashes here.

File details

Details for the file dnsight-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dnsight-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 185.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dnsight-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 696f1f656e6fff0e00950960ec87f8f9cc533a20033211bb2edfeb2141f89697
MD5 c77f1c865cc1734fee9a7e81b7b6f24e
BLAKE2b-256 3294a030c0735c6c73fd01e48504736b957aae9504d4ed12c80005590e541e9d

See more details on using hashes here.

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