Skip to content

DNS should be case insensitive #189

Closed
@provonet

Description

@provonet

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

Activity

provonet

provonet commented on Jun 3, 2014

@provonet
Author

Forgot to add the used version, we are using version 0.2.1

andrewwatson

andrewwatson commented on Jun 6, 2014

@andrewwatson
Contributor

yikes, DNS is definitely not sensitive per the RFC. 👍

armon

armon commented on Jun 6, 2014

@armon
Member

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

armon commented on Jun 6, 2014

@armon
Member

Similarly the "postgresql" and "POSTGRESQL" service are allowed to be distinct

carlosdp

carlosdp commented on Jun 9, 2014

@carlosdp

What is the use-case for having two tags/services of the same name with different casing?

armon

armon commented on Jun 10, 2014

@armon
Member

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

tiwilliam commented on Jun 12, 2014

@tiwilliam
Contributor

I had a look at this yesterday and got all interfaces case-insensitive, still need some refactoring but I'm working on this.

self-assigned this
on Jun 12, 2014
armon

armon commented on Jun 12, 2014

@armon
Member

@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

tiwilliam commented on Jun 12, 2014

@tiwilliam
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @andrewwatson@tiwilliam@carlosdp@provonet@armon

    Issue actions

      DNS should be case insensitive · Issue #189 · hashicorp/consul