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

Allow to control the number of A/AAAA Record returned by DNS #3940

Merged
merged 4 commits into from
Mar 9, 2018

Conversation

pierresouchay
Copy link
Contributor

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.

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.
@@ -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,
Copy link
Contributor

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...

Copy link
Contributor Author

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

Copy link
Contributor

@preetapan preetapan left a 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

@preetapan
Copy link
Contributor

Could you also add documentation for the new option to https://www.consul.io/docs/agent/options.html#dns_config

@pierresouchay
Copy link
Contributor Author

@preetapan DONE in the next patch!

Copy link
Contributor Author

@pierresouchay pierresouchay left a comment

Choose a reason for hiding this comment

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

Fine

@pierresouchay
Copy link
Contributor Author

After this PR, you might have a look on #3948 which solves also issues on large clusters

@preetapan preetapan merged commit 210cfe5 into hashicorp:master Mar 9, 2018
@pearkes pearkes added this to the 1.0.7 milestone Mar 13, 2018
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.

dns.config.udp_answer_limit not taken into account if edns is used
3 participants