feat: allow manual configuration of dns resolver#40
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for manually configuring a custom DNS resolver in Nylon. When configured, the application will use the specified DNS server (in ip:port format) for its own DNS queries instead of relying on the system's default resolver.
Key changes:
- Added
DnsResolverconfiguration field toLocalCfgstruct - Implemented validation to ensure DNS resolver is specified in valid
ip:portformat - Custom DNS resolver is set via
net.DefaultResolverduring Nylon initialization
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| state/config.go | Added DnsResolver string field to LocalCfg struct |
| state/validation.go | Added validation logic to ensure DnsResolver is a valid ip:port address using netip.ParseAddrPort |
| state/validation_test.go | Added test cases verifying the validation of DNS resolver values (valid IPv4:port, invalid hostname, hostname:port, and IP without port) |
| example/sample-node.yaml | Added documentation comment explaining the dnsresolver configuration option with example value |
| core/nylon.go | Implemented custom DNS resolver by configuring net.DefaultResolver with a custom dialer when DnsResolver is set |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a36b277 to
cdc019d
Compare
a8d799c to
01d8b61
Compare
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.
No description provided.