Closed
Description
DNS resolving is now case sensitive which makes it impossible to ssh in to a server or container if there is a capital letter in the hostname.
example:
ping postgresql.node.consul
ping: unknown host postgresql.node.consul
but:
ping Postgresql.node.consul
PING Postgresql.node.consul (172.17.0.5) 56(84) bytes of data.
64 bytes from 172.17.0.5: icmp_seq=1 ttl=64 time=0.061 ms
64 bytes from 172.17.0.5: icmp_seq=2 ttl=64 time=0.078 ms
Metadata
Metadata
Assignees
Labels
No labels
Activity
provonet commentedon Jun 3, 2014
Forgot to add the used version, we are using version 0.2.1
andrewwatson commentedon Jun 6, 2014
yikes, DNS is definitely not sensitive per the RFC. 👍
armon commentedon Jun 6, 2014
So an interesting mis-match we have is that Consul IS case-sensitive for tags + services.
Meaning, if there happens to be a "foo" and "Foo" tag for the "postgresql" service, "foo.postgresql.service.consul" and "Foo.postgresql.service.consul" actually resolve differently.
I'm not sure how to handle case-insensitive DNS without creating an ambiguity in the lookup.
armon commentedon Jun 6, 2014
Similarly the "postgresql" and "POSTGRESQL" service are allowed to be distinct
carlosdp commentedon Jun 9, 2014
What is the use-case for having two tags/services of the same name with different casing?
armon commentedon Jun 10, 2014
No good use case. On thinking about this further, Consul does not currently definite case sensitivity, so we wouldn't be breaking a backwards compatibility promise. Instead, we can define case-insensitive and both fix this bug and have more clearly defined semantics. This may not happen for 0.3 but maybe 0.4
tiwilliam commentedon Jun 12, 2014
I had a look at this yesterday and got all interfaces case-insensitive, still need some refactoring but I'm working on this.
armon commentedon Jun 12, 2014
@tiwilliam Awesome. I'd love to talk more about this while you are working on it. I think that largely we can do this all in the state store by just doing a ToLower on all the indexes and corresponding read values. I think most of the changes can actually be localized to the MDBTable
tiwilliam commentedon Jun 12, 2014
Yeah, that's basically what I have, and then ToLower in
DNSServer.dispatch
etc. I did the ToLower on one level above the MDBTable when storing, but I can try to move it.