-
Notifications
You must be signed in to change notification settings - Fork 678
Resolve unqualified names in the local WeaveDNS domain #1050
Conversation
// normalize a name by | ||
// a) adding the local domain when it is a single component name | ||
// b) converting the result to FQDN | ||
func nameNormalize(n string, domain string) string { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
It seems plausible to me that a user has some set-up where they are already using unqualified names in their environment outside of Docker. So whilst I agree with the premise of #987, it might be safer to have an option to disable this new behaviour. |
@bboreham suggestion seems reasonable. I will add a command line flag... |
Nooooooo! Not more command line flags! We can think about adding that when we have a user running into problems because of it. |
Ok, then no more command line flags... |
@@ -372,9 +369,19 @@ func (s *DNSServer) localHandler(proto dnsProtocol, kind string, qtype uint16, | |||
func (s *DNSServer) notUsHandler(proto dnsProtocol) dns.HandlerFunc { | |||
dnsClient := proto.GetNewClient(DefaultUDPBuflen, s.timeout) | |||
|
|||
localNameResolver := s.localHandler(proto, "Query", dns.TypeA, | |||
s.Zone.DomainLookupName, makeAddressReply, s.Zone.ObserveName, failHandleFunc) | |||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
That's right: |
@inercia anything left to do here |
If there are no more comments on your side, I think I'm done with it... |
ok. next time please assign back to me. |
# check that unqualified names are automatically qualified when looking up | ||
weave_on $HOST1 dns-add $C2 c2 -h name1.$DOMAIN | ||
assert_dns_a_record $HOST1 c2 name1 $C2 name1.$DOMAIN | ||
|
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Seems that alpine will not even add a |
why not? |
Because the minimum pattern seems to be |
Raise an issue against |
Doesn't this line mean that pattern |
@bboreham I'm think it doesn't... |
I added a debug print at the top of
|
What is left to do here? |
I will close this PR, as it will have to be reimplemented once the new DNS code is in place... |
If this is ready to merge then we should do so. What is missing? |
It seems that broken resolvers add a |
|
||
start_container $HOST1 $C1/24 --name=c1 -h $NAME | ||
start_container_with_dns $HOST1 $C2/24 --name=c2 -h seetwo.$DOMAIN | ||
start_container_with_dns $HOST1 $C3/24 --name=c3 --dns-search=$DOMAIN | ||
container=$(start_container_with_dns $HOST1 $C4/24) | ||
start_container $HOST1 $C5/24 --name=c5 -h short.$DOMAIN |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
LGTM |
r.MsgHdr.Id, server, q.Name) | ||
continue | ||
w.WriteMsg(reply) | ||
return |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Resolve unqualified names in the local WeaveDNS domain Closes #987.
I've had to revert this since it fails the integration tests on master. |
Fixes #987