-
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
DNS query fails when querying with DC and the DC name has suffix that conflicts with domain/alt_domain #17156
Comments
I suspect this might be because of the trimDomain function: Lines 1050 to 1062 in f93bb65
If the query is |
Thanks @jkirschner-hashicorp for pointing out to the code, I guess this can be easily fixed, with something like: longer := "." + strings.TrimLeft(d.domain, ".")
shorter := "." + strings.TrimLeft(d.altDomain, ".") |
@shamil : Would you be interested in contributing such a fix? If so, here is some guidance on making changes to Consul. |
@jkirschner-hashicorp sure, submitted #17160 |
Overview of the Issue
When
domain
/alt_domain
name begins with a portion of the DC name, dns query may fail.It will be easier to see the issue in the reproduction steps below...
Reproduction Steps
For the sake of reproduction, I will start
consul
in development mode, but the issue also occurs in production deployments.Steps to reproduce this issue:
consul
with the following params:Log Fragments
In the logs, for the last example in the reproduction steps, we can clearly see that
consul
doesn't parse the DC properly:Additional information
.
) to do alt-domain helps, eg.alt-domain=.test.consul
, but I'm not sure this is the desired behaviour.domain
withalt-domain
, e.galt-domain=consul
,domain=test.consul
, so it's not specific toalt-domain
.Consul info for both Client and Server
Client/Server info
The text was updated successfully, but these errors were encountered: