-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Allow to control the number of A/AAAA Record returned by DNS #3940
Conversation
This allows to have randomized resource records (i.e. each answer contains only one IP, but the IP changes every request) for A, AAAA records. It will fix hashicorp#3355 and hashicorp#3937 See hashicorp#3937 (comment) for details. It basically add a new option called `a_record_limit` and will not return more than a_record_limit when performing A, AAAA or ANY DNS requests. The existing `udp_answer_limit` option is still working but should be considered as deprecated since it works only with DNS clients not supporting EDNS.
agent/dns_test.go
Outdated
@@ -2997,6 +2997,163 @@ func testDNSServiceLookupResponseLimits(t *testing.T, answerLimit int, qType uin | |||
return true, nil | |||
} | |||
|
|||
func testDNSServiceLookupResponseARecordLimits(t *testing.T, generateNumNodes int, aRecordLimit int, qType uint16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just have this return an error instead of both an error and bool, and check whether an error occurred.
Also, can you rename this to checkDNSService...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@preetapan DONE in next patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion, otherwise LGTM
Could you also add documentation for the new option to https://www.consul.io/docs/agent/options.html#dns_config |
@preetapan DONE in the next patch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine
After this PR, you might have a look on #3948 which solves also issues on large clusters |
This allows to have randomized resource records (i.e. each answer contains only one IP, but the IP changes every request) for A, AAAA records.
It will fix #3355 and #3937
See #3937 (comment) for details.
It basically add a new option called
a_record_limit
and will not return more than a_record_limit when performing A, AAAA or ANY DNS requests.The existing
udp_answer_limit
option is still working but should be considered as deprecated since it works only with DNS clients not supporting EDNS.