Skip to content

fix: skip negative DNS caching for managed domains#155

Merged
robindiddams merged 1 commit intomainfrom
dns-skip-negative-cache-managed-domains
Jan 30, 2026
Merged

fix: skip negative DNS caching for managed domains#155
robindiddams merged 1 commit intomainfrom
dns-skip-negative-cache-managed-domains

Conversation

@robindiddams
Copy link
Member

@robindiddams robindiddams commented Jan 30, 2026

Summary

  • Prevents NXDOMAIN responses for managed domains (e.g., *.agentuity.live) from being cached
  • Allows rapid DNS propagation for dynamically created subdomains

Changes

Added a check in cacheResponse() that skips negative caching when the domain matches IsManagedDomain(). This ensures that temporary NXDOMAIN responses for managed domains don't get cached, which is important for domains that are dynamically created.

Testing

  • All existing tests pass (go test ./dns/...)
  • Positive caching behavior is unchanged
  • Only negative responses (NXDOMAIN/NODATA) for managed domains are affected

Summary by CodeRabbit

  • Bug Fixes
    • Improved DNS resolver caching behavior for managed domains. The system now correctly skips negative caching for managed domains when negative responses occur, preventing cache pollution and improving resolution reliability. Enhanced logging provides better visibility into caching decisions.

✏️ Tip: You can customize this high-level summary in your review settings.

Prevents NXDOMAIN responses for managed domains (e.g., *.agentuity.live)
from being cached, allowing rapid DNS propagation for dynamically
created subdomains.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Adds a guard in DNSResolver.cacheResponse to skip negative caching for managed domains. When handling negative responses (NODATA/NXDOMAIN) for managed domains, the code logs a debug message and returns early, preventing negative cache entries from being stored.

Changes

Cohort / File(s) Summary
Negative Caching Guard
dns/server.go
Introduces conditional logic in cacheResponse to bypass negative caching for managed domains with debug logging and early return.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09798c1 and c81b4d1.

📒 Files selected for processing (1)
  • dns/server.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
dns/server.go (1)

1010-1015: Good guard to skip negative caching for managed domains.

This cleanly enforces the intended behavior without impacting non-managed domains.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@robindiddams robindiddams merged commit 4b8000a into main Jan 30, 2026
5 checks passed
@robindiddams robindiddams deleted the dns-skip-negative-cache-managed-domains branch January 30, 2026 15:01
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