Skip to content

Conversation

@l1a
Copy link

@l1a l1a commented Dec 8, 2025

This PR bundles several maintenance updates, fixes, and features accumulating in my fork.

Summary of Changes

  • Dependencies: Significant updates to Cargo.lock and Cargo.toml. Removed openssl-sys and native-tls in favor of a simplified build/TLS approach.
  • CI/CD: Added a GitHub Actions workflow (.github/workflows/rust.yml) to ensure build and test stability.
  • Fixes: Improved reverse lookup logic for IPv4 and IPv6 to correctly handle IP inputs without blindly appending suffixes.
  • Tests: Added unit tests for the new reverse lookup logic in src/options.rs.
  • Shell Completions: Added Nu shell support and updated Fish completions.
  • Documentation: Minor updates to README and versioning.

This ensures the project is up-to-date with modern Rust tooling and provides better cross-platform stability with the CI.

l1a added 30 commits September 11, 2025 11:20
Adds a pseudo record type "ANY" that queries the given domain for all known record types.

This is implemented by adding an `all_record_types()` function that returns a vector of all `RecordType` variants. The command-line option parsing logic is updated to check for "ANY" and, if present, populate the record_types field with the list of all record types.

The test suite has been updated to reflect this new functionality.
Removes the `specsheet` dependency and the entire `xtests` directory.

This simplifies the testing setup and removes a dependency that is not consistently available.
- Add support for DNSSEC record types:
  * DS (Delegation Signer) - RFC 4034
  * RRSIG (DNSSEC Signature) - RFC 4034
  * NSEC (Next Secure) - RFC 4034
  * DNSKEY (DNS Key) - RFC 4034
  * NSEC3 (Next Secure v3) - RFC 5155
  * NSEC3PARAM (NSEC3 Parameters) - RFC 5155
  * IPSECKEY (IPsec Key) - RFC 4025
  * DHCID (DHCP Identifier) - RFC 4701

- Add support for SMIMEA record type (S/MIME certificate association) - RFC 8162

- Implement full parsing, validation, and display for all new record types
- Add JSON output serialization for all new types
- Add colored terminal output for new record types
- Include comprehensive test coverage for all new implementations

- Fix compilation issue: missing closing brace in output match statement
- Improve ANY query handling: suppress Format Error when server provides records
- Update all integration points: parsing, display, JSON, and coloring

All new record types follow the established patterns for error handling,
length validation, and output formatting. Tests pass for all implementations.
- Add comprehensive DNSSEC record type documentation:
  * DS, DNSKEY, RRSIG, NSEC, NSEC3, NSEC3PARAM records
  * DHCID, IPSECKEY, SMIMEA records

- Update README.md with enhanced description and examples:
  * Mention comprehensive DNSSEC support
  * Add examples for DS, DNSKEY, and RRSIG queries

- Update man page (dog.1.md):
  * Add all new record types to RECORD TYPES section
  * Include RFC references for each type
  * Update version to reflect current development state

All documentation now accurately reflects the extended DNS record type support.
…type support

- Add full support for DNSSEC record types:
  * DS (Delegation Signer) - RFC 4034
  * RRSIG (DNSSEC Signature) - RFC 4034
  * NSEC (Next Secure) - RFC 4034
  * DNSKEY (DNS Key) - RFC 4034
  * NSEC3 (Next Secure v3) - RFC 5155
  * NSEC3PARAM (NSEC3 Parameters) - RFC 5155
  * IPSECKEY (IPsec Key) - RFC 4025
  * DHCID (DHCP Identifier) - RFC 4701
  * SMIMEA (S/MIME certificate association) - RFC 8162

- Implement complete parsing, validation, and display for all record types
- Add JSON serialization support for all new types
- Add colored terminal output for new record types
- Include comprehensive unit tests and documentation updates
- Fix compilation issues and improve ANY query handling

This merge brings enhanced DNSSEC support and extended record type capabilities to the main branch.
This commit refactors the entire crate to use the `hickory-resolver`
library for all DNS resolution, removing the custom `dns` and
`dns-transport` crates. This change simplifies the codebase, improves
maintainability, and leverages a well-tested, feature-rich library for
future development.

Major changes include:

- **Dependency Change:** Removed local `dns` and `dns-transport` crates
  and added `hickory-resolver` and `tokio` to `Cargo.toml`.
- **Async Refactor:** The `main` function and DNS lookups are now fully
  asynchronous using the `tokio` runtime.
- **Code Simplification:** Deleted the entire custom DNS protocol and
  transport implementation, including modules for requests, responses,
  wire formatting, and connection handling.
- **Option Parsing:** The `options` module was significantly simplified to
  remove arguments related to the old resolver's implementation details,
  such as EDNS, transaction IDs, and protocol tweaks.
- **Output Formatting:** The `output` and `table` modules were updated to
  work with the response types from `hickory-resolver`. Color-coding for
  different record types has been reintroduced.
- **Testing:** Unit tests for command-line option parsing and output
  formatting have been updated or added to reflect the new implementation.
- **Documentation:** The `README.md` and man page have been updated to
  remove references to unsupported features and reflect the new,
  simplified command-line options.
This commit adds documentation to all public modules, functions, and
structs in the `src` directory. This improves the maintainability and
readability of the codebase.

- **`src/colours.rs`:** Added doc comments to the `Colours` struct and
  its fields.
- **`src/hints.rs`:** No changes were needed as the documentation was
  already sufficient.
- **`src/logger.rs`:** Added doc comments to the `configure` function
  and the `Logger` struct.
- **`src/main.rs`:** Added doc comments to the `main` and `run`
  functions, as well as the helper functions for displaying usage and
  version information.
- **`src/options.rs`:** Added doc comments to the `Requests` struct and
  its fields, as well as the private functions in the `Inputs`
  implementation.
- **`src/table.rs`:** Added doc comments to the private functions.
This commit introduces a new command-line option, `-l` or `--list`,
which displays a comprehensive table of all known and queryable DNS
record types supported by the application.

- **`src/options.rs`:** Added the `--list` flag and a new `ListTypes`
  variant to the `OptionsResult` enum. A new function `all_record_types`
  was added to provide the data for the table.
- **`src/main.rs`:** Added logic to handle the `ListTypes` variant and
  print the formatted table to the console.
- **`src/usage.txt`:** Updated the help text to include the new option.
- **`README.md` and `man/dog.1.md`:** Updated the documentation to
  include the new option and the list of supported record types.
This commit bumps the version of the application to 0.4.0-pre to
reflect the recent feature additions and refactoring.

- **`Cargo.toml`:** Updated the package version.
- **`man/dog.1.md`:** Updated the version in the man page.
This commit introduces a new `-v, --verbose` option to display detailed
information about the DNS query, including the transport protocol,
nameserver, and timing information.

Major changes include:

- **`src/options.rs`:** Added the `--verbose` flag and re-introduced
  the `TransportType` enum to support transport protocol selection.
- **`src/main.rs`:** Implemented the verbose output format and added
  robust logic to handle nameservers specified by IP address or domain
  name for all transport protocols, including TLS and HTTPS.
- **`src/output.rs`:** Updated the `print` function to handle the new
  verbose output format.
- **Documentation:** Updated `README.md`, `man/dog.1.md`, and
  `src/usage.txt` to reflect the new `--verbose` option and the change
  of the version flag from `-v` to `-V`.
The verbose output will now display a comma-separated list of all
the nameservers being queried, rather than just the first one.
When the --verbose flag is used, the 'Query for...' lines will now
be immediately followed by their corresponding results. This makes the
output easier to follow when querying for multiple record types.
Refactor the command-line argument parsing to correctly determine the
transport type (UDP, TCP, TLS, HTTPS) before parsing other options.

This fixes a bug where using a flag such as --tls along with a
nameserver specified with the '@' syntax (e.g., @1.1.1.1) would fail
because the transport type was not being correctly identified.
The 'ANY' query type should not include PTR records, as these are
used for reverse lookups (IP to domain) and do not make sense when
querying for a domain name.

This commit removes the PTR record type from the list of records
queried when the 'ANY' type is specified.
l1a added 18 commits September 18, 2025 10:32
- Remove measure_time from Options struct and related logic
- Update shell completions for fish, PowerShell, and zsh
- Update README, man page, and usage help message
- Remove unused from_args function and MultipleTransports error
- All tests pass and compile warnings resolved
- Replace ResolverConfig::default() with manual loading of system DNS servers
- On Unix: Parse /etc/resolv.conf to get nameservers
- On Windows: Use ipconfig crate to retrieve DNS servers from adapters
- Add fallback to Google DNS if no system nameservers found
- Add comments explaining the cross-platform logic
- Suppress false positive unused import warnings

Fixes issue where default resolver didn't use system's DNS server on some platforms.
…cation

- Previously, build.rs added the tagline 'dog ○ command-line DNS client' and usage.txt started with the same, causing the --help text to show the description twice.
- Now usage.txt starts with 'Usage:' directly, avoiding the duplication while keeping the colored title from build.rs.
- Change version in Cargo.toml and Cargo.lock from 0.4.0-pre to 0.4.1-pre
- Update man/dog.1.md header to reflect new version
- Remove unused feature-checking code from build.rs that added [-idna, -https] to version output
- The features did not exist as Cargo features nor gate any code, so they were misleading
- Adds a new recipe that installs the release version locally using 'cargo install --path .'
- Useful for quickly installing the updated binary after builds
- Removed fuzz, fuzz-hex, fuzz-clean recipes that referenced non-existent dns crate
- Removed test-mutation recipe that referenced non-existent dns package and features
- Project now uses hickory-resolver instead of local dns crate
- Updated hickory-resolver to 0.24 (latest stable)
- Updated tokio, rand, and other deps to latest within compatibility
- Removed obsolete fuzz and mutation recipes
- Pinned to stable hickory-resolver to avoid breaking changes in 0.25
- Fix indentation in resolver config matching
- Pass &data to record_payload_summary as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant