Skip to content

feat(dns): implement DNS forwarding and resolution with fragmentation…#234

Merged
DanielLavrushin merged 4 commits into
mainfrom
dns-set-redirect
Jun 1, 2026
Merged

feat(dns): implement DNS forwarding and resolution with fragmentation…#234
DanielLavrushin merged 4 commits into
mainfrom
dns-set-redirect

Conversation

@DanielLavrushin

Copy link
Copy Markdown
Owner

… support

  • Added ResolveUpstream function to handle DNS queries with optional fragmentation.
  • Introduced ForwardOptions struct to configure DNS forwarding behavior.
  • Implemented fragmented query sending for both IPv4 and IPv6.
  • Created unit tests for DNS resolution and timeout scenarios.

refactor(utils): replace random number generation with cryptographic methods

  • Replaced custom random number generation with secure random functions in the utils package.
  • Added RandUint16 and RandUint32 functions for generating random values.

fix(nfq): remove DNS NAT handling

  • Deleted DNS NAT management code from nat.go as it is no longer needed.
  • Updated DNS packet processing logic to eliminate reliance on NAT entries.

test: enhance unit tests for UDP packet building and checksum validation

  • Added tests for BuildUDPPacketV4 and BuildUDPPacketV6 to ensure correct packet structure and checksum calculations.
  • Implemented tests for random number generation functions to verify randomness and distribution.

chore: update changelog for version 1.64.0

… support

- Added `ResolveUpstream` function to handle DNS queries with optional fragmentation.
- Introduced `ForwardOptions` struct to configure DNS forwarding behavior.
- Implemented fragmented query sending for both IPv4 and IPv6.
- Created unit tests for DNS resolution and timeout scenarios.

refactor(utils): replace random number generation with cryptographic methods

- Replaced custom random number generation with secure random functions in the `utils` package.
- Added `RandUint16` and `RandUint32` functions for generating random values.

fix(nfq): remove DNS NAT handling

- Deleted DNS NAT management code from `nat.go` as it is no longer needed.
- Updated DNS packet processing logic to eliminate reliance on NAT entries.

test: enhance unit tests for UDP packet building and checksum validation

- Added tests for `BuildUDPPacketV4` and `BuildUDPPacketV6` to ensure correct packet structure and checksum calculations.
- Implemented tests for random number generation functions to verify randomness and distribution.

chore: update changelog for version 1.64.0
Copilot AI review requested due to automatic review settings June 1, 2026 13:05
@codacy-production

codacy-production Bot commented Jun 1, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Complexity 1 medium

View in Codacy

🟢 Metrics 73 complexity

Metric Results
Complexity 73

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Comment thread src/utils/utils.go
Comment thread src/utils/utils.go
Comment thread src/sock/udp_ipv4.go
Comment thread src/sock/udp_ipv6.go
Comment thread src/utils/utils.go
Comment thread src/utils/utils.go
Comment thread src/sock/udp_ipv4.go
Comment thread src/sock/udp_ipv6.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Comment thread src/utils/utils.go
Comment thread src/utils/utils.go
Comment thread src/dns/forward.go Outdated
Comment thread src/dns/forward.go Outdated
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Comment thread src/utils/utils.go
Comment thread src/utils/utils.go
@DanielLavrushin DanielLavrushin merged commit 8bdf134 into main Jun 1, 2026
2 of 3 checks passed
@DanielLavrushin DanielLavrushin deleted the dns-set-redirect branch June 1, 2026 18:55
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.

2 participants