Skip to main content

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

Project description

dnsight

Quality CI codecov Quality Gate
Package PyPI Python PyPI - Downloads/week PyPI - Downloads/month
Meta License: MIT Docs
Stack uv Ruff just SonarCloud Aikido
Discussions Roadmap Ideas

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.1.tar.gz (326.8 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.1-py3-none-any.whl (185.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dnsight-1.0.1.tar.gz
  • Upload date:
  • Size: 326.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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.1.tar.gz
Algorithm Hash digest
SHA256 1d41fc99d6e41d5ff7a0813658f28582767791d83af4399f49725a289a431f17
MD5 0d41811fc574b7b83ac2d75a19d4689e
BLAKE2b-256 ad35f14e6066682f2f3a959842dbe408105293e003e338336f8635923f5ad6c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dnsight-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 185.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea443410b858d943fba929face6264ca81c3361e9e0fdad8b348f79cd66db754
MD5 b605a107ba19728a747e9a7b1b02c9f8
BLAKE2b-256 c40cfcca99b6f1c386b28461179d6fb16b16fe55d9dc99f2a84fc3ad765e6765

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