Skip to content

feat(eldritch): refactor dns to list and add CNAME support#2193

Merged
Cictrone merged 3 commits intomainfrom
feature/dns-list
Apr 11, 2026
Merged

feat(eldritch): refactor dns to list and add CNAME support#2193
Cictrone merged 3 commits intomainfrom
feature/dns-list

Conversation

@Cictrone
Copy link
Copy Markdown
Collaborator

Refactor dns library and add CNAME support

Overview

This PR refactors our newly introduced dns.list_a_records function to be more generic and extensible. The core method has been renamed to dns.list and now accepts an optional record_type parameter (capable of resolving "A" and "CNAME" records natively). To ensure code quality and testability, resolution logic within the std bindings has been separated into dedicated internal helper methods.

Key Changes

  • API Redesign: Replaced the rigid dns.list_a_records with dns.list(domain, record_type='A', nameserver=None), enabling multi-type DNS probing.
  • CNAME Support: Operators can now resolve CNAME records by invoking dns.list("domain.com", record_type="CNAME"). Defaults safely to IPv4 (A) if unspecified.
  • Architectural Flow: Migrated the internal resolution logic from sweeping monolith functions into streamlined resolve_a_records() and resolve_cname_records() functions within std/mod.rs for readability and maintainability.
  • Testing / Mock Adjustments: Extended DnsLibraryFake to appropriately handle assertions over both record types to guarantee mock-test coverage without breaking cargo check/WASM builds.
  • Documentation: Overhauled docs/_docs/user-guide/eldritch.md to reflect dns.list along with functional snippet examples capturing the default and keyword invocation structures.

Testing

  • Verified cargo test -p eldritch succeeds
  • Checked cargo check -p eldritch-libdns
  • Tested both A and CNAME return values in fake/std logic paths.

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
719 719 0 0 0 0 1ms

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#1988 719 719 0 0 0 0 41.6s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
719 0 0 5.5s

Test Changes

0 test added, 0 removed

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
TestDockerExecutor_Build_ContextCancellation 1 5.5s 5.5s
TestInteractiveShell 1 5.1s 5.1s
TestOtherStreamOutput 1 5.0s 5.0s
TestDockerExecutor_Build_SimpleEcho 1 2.9s 2.9s
TestGetRandomName/NoDuplicates 1 1.5s 1.5s
TestGetRandomName 1 1.5s 1.5s
TestDockerExecutor_Build_StreamsOutputInRealTime 1 1.3s 1.3s
TestCreateTestData 1 1.3s 1.3s
TestAPI 1 1.1s 1.1s
TestTruncation 1 1.0s 1.0s

🎉 No failed tests in this run. | 🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

@Cictrone Cictrone merged commit 18b3b74 into main Apr 11, 2026
8 checks passed
@Cictrone Cictrone deleted the feature/dns-list branch April 11, 2026 19:50
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