feat: [#336] add DNS resolution check to test command#338
Merged
josecelano merged 11 commits intomainfrom Feb 11, 2026
Merged
Conversation
- Create src/infrastructure/dns/ module with DnsResolver - Implement system DNS resolution using std::net::ToSocketAddrs - Add resolve() method to get IP addresses for domains - Add resolve_and_verify() to check against expected IPs - Add DnsResolutionError with ResolutionFailed and IpMismatch variants - Update infrastructure mod.rs to include dns module - Add comprehensive module documentation - Add unit tests for resolver creation Phase 1 of 3: DNS Resolution Infrastructure complete
TestCommandHandler.execute() now returns TestResult containing advisory DNS warnings instead of unit type. This follows the same pattern as ListCommandHandler returning EnvironmentList. - Add TestResult, DnsWarning, DnsIssue types in application layer - Handler extracts configured domains and checks DNS resolution - Presentation controller renders DNS warnings from the result - No UserOutput passed to application layer (proper DDD separation) - Fix doctest crate name in DnsResolver
ServiceEndpoint is a layer-agnostic validated wrapper (like DomainName, BindAddress) used by both application and infrastructure layers. Moving it from infrastructure/external_validators to shared/ makes its role clearer as a generic utility type that doesn't belong to any specific layer.
8377e97 to
b304f9b
Compare
Member
Author
|
ACK b304f9b |
josecelano
added a commit
that referenced
this pull request
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #336
Adds an advisory DNS resolution check to the
testcommand. When TLS domains are configured for services (API, HTTP trackers, health check, Grafana), the test command now verifies that each domain resolves to the expected instance IP via system DNS.Changes
Phase 1: DNS resolution infrastructure
DnsResolverinsrc/infrastructure/dns/usingstd::net::ToSocketAddrsresolve()returns all resolved IPs for a domainresolve_and_verify()checks resolved IPs against an expected IPDnsResolutionErrorenum withResolutionFailedandIpMismatchvariantsPhase 2: DNS check in test command with structured TestResult
TestResulttype insrc/application/command_handlers/test/result.rswithdns_warnings: Vec<DnsWarning>DnsWarningcontains domain, expected IP, andDnsIssue(ResolutionFailed or IpMismatch)TestCommandHandler.execute()returnsResult<TestResult, ...>— follows the establishedListCommandHandler→EnvironmentListpatternArchitecture decisions
TestResultreturn typeUserOutputin command handlersBehavior
Testing
TestResult,DnsWarning,DnsIssue,DnsResolver)/etc/hostsis configured