Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns: New resolver backend "miekgdns2" with reliability improvements #660

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

56quarters
Copy link
Contributor

What this PR does:

Create a new version of the dns/miekgdns package with changes to improve the reliability of queries since they are typically used for service discovery.

The notable changes:

  • Search domains are not supported. We don't use them, when they are used they put more load on DNS servers, and they make the behavior of resolution harder to understand.
  • Always use TCP for queries, don't start with UDP. We're using DNS for service discovery and the result size is usually large enough that TCP must be used anyway. Instead of starting with UDP and needing to wait N seconds to know if the packet was dropped - just start with TCP.
  • Pool connections to DNS servers. Instead of creating new UDP and TCP sockets for every query, we keep TCP connections to DNS servers open and reuse them if possible.
  • Use the "attempts" option from /etc/resolv.conf. Instead of failing the query immediately due to network issues, we retry based on the "attempts" setting which is 2 by default.

This change also makes the resolver backend used by the Memcached client configurable so that we can test the new backend before making it the default implementation.

Which issue(s) this PR fixes:

N/A

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@56quarters 56quarters force-pushed the 56quarters/tcp-dns branch from 12aa0be to 7e180e4 Compare March 5, 2025 21:54
Create a new version of the `dns/miekgdns` package with changes to improve
the reliability of queries since they are typically used for service
discovery.

The notable changes:
* Search domains are not supported. We don't use them, when they are
  used they put more load on DNS servers, and they make the behavior
  of resolution harder to understand.
* Always use TCP for queries, don't start with UDP. We're using DNS
  for service discovery and the result size is usually large enough
  that TCP must be used anyway. Instead of starting with UDP and
  needing to wait N seconds to know if the packet was dropped - just
  start with TCP.
* Pool connections to DNS servers. Instead of creating new UDP and
  TCP sockets for every query, we keep TCP connections to DNS servers
  open and reuse them if possible.
* Use the "attempts" option from /etc/resolv.conf. Instead of failing
  the query immediately due to network issues, we retry based on the
  "attempts" setting which is 2 by default.

This change also makes the resolver backend used by the Memcached
client configurable so that we can test the new backend before making
it the default implementation.

Signed-off-by: Nick Pillitteri <[email protected]>
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