Table of contents
Thanks for your interest in contributing! This document outlines how to propose changes, report issues, and develop locally. The project follows common practices used across the Rust crates community.
This project adheres to a Code of Conduct. By participating, you agree to uphold it.
- Report bugs or suggest improvements via GitHub Issues
- Implement features (check open issues or propose new ones)
- Improve documentation (README, Docker overview, examples)
- Add tests and benchmarks
- Triage issues (labels, reproductions, platform checks)
- Rust toolchain (stable) installed via rustup
- Cargo (bundled with rustup)
- For Docker-related work: Docker and optionally Buildx/QEMU for multi-arch
This repo supports devcontainers. You can open it in VS Code with the Dev Containers extension (or GitHub Codespaces) to get a pre-configured environment:
- Install VS Code and the Dev Containers extension
- Open the repository
- Use "Reopen in Container" to start a reproducible dev environment
Devcontainers are helpful for consistent toolchains, multi-arch testing, and running CI-like builds locally.
cargo buildcargo run -- [OPTIONS]Common quick runs:
# IPv4 benchmark with short timeout
cargo run -- --name-servers-ip v4 --lookup-ip v4 --timeout 1
# Use custom servers list
cargo run -- --custom-servers-file ./examples/ipv4-custom-servers-example.txtcargo testCI runs cargo build, cargo test, cargo fmt --check, and cargo clippy -D warnings across platforms and toolchains.
- Formatting:
cargo fmt - Linting:
cargo clippy --all-features -- -D warnings
src/— application source codecommands/— subcommands handlingoutput/— formatters (table, json, xml, csv)
tests/— test assetsdocker/— Dockerfiles and CI scripts for image buildsexamples/— example server lists and usage samplesREADME.md— usage, installation, and reference docsRELEASE.md— release process checklistCHANGELOG.md— release notesSECURITY.md— how to report security issues
- Keep default behavior sane. See
DnsBenchConfigdefaults and CLI. - Add flags for opt-in changes (e.g.,
--disable-adaptive-timeout). - Ensure output formats (table/JSON/XML/CSV) remain consistent.
- Maintain cross-platform support (Linux, Windows, macOS). Features such as automatic gateway address detection and automatic system DNS servers detection must work reliably across all three OS families; include platform notes and tests where feasible.
- Prefer small, incremental PRs.
- Avoid unnecessary allocations and re-use resolvers thoughtfully.
- Keep benchmarks deterministic where practical; document adaptation logic.
- For long-running or multi-arch Docker builds, consider Buildx cache and matrix strategies.
- Add unit tests for new logic (error classification, formatting, etc.)
- Maintain or improve coverage for changed code paths
- Include edge cases (timeouts, unreachable servers, invalid inputs)
- Update README.md and examples when adding or changing CLI arguments
- Add changelog entries under
## Unreleasedand reference commits/issues
- Use conventional, descriptive commit messages (e.g.,
feat:,fix:,docs:) - Reference issues (e.g.,
resolves #123) when applicable - Keep PRs focused; include notes on testing and potential impacts
To prepare and publish a new release:
- See RELEASE.md
Please report vulnerabilities via the documented security protocol.
- See SECURITY.md
By contributing, you agree that your contributions will be licensed under the terms listed in LICENSE-APACHE and LICENSE-MIT.