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

ndots issue on daemon config for services #1988

Closed
fcrisciani opened this issue Oct 18, 2017 · 3 comments · Fixed by #1995 or moby/moby#35976
Closed

ndots issue on daemon config for services #1988

fcrisciani opened this issue Oct 18, 2017 · 3 comments · Fixed by #1995 or moby/moby#35976

Comments

@fcrisciani
Copy link

If the dns options is specified in the daemon.json like:

{
  "debug" : true,
  "dns-opts" : [
    "ndots:1"
  ],
  "experimental" : true
}

If a service is launched on a network like:
docker service create --network net1 alpine top

the resolv.conf results in:

options ndots: 2 ndots:0

Looks like the daemon config is ignored and the ndots:0 is appended blindly

@joeabbey
Copy link

Looks like ndots is almost entirely ignored. In sandbox_dns_unix.go, the number of dots is parsed only for validation. As you mentioned it is appended blindly, see sandbox_dns_unix.go:384:
dnsOptionsList = append(dnsOptionsList, resOptions...)
This probably works for forwarding unsupported options on... but seems like it would be easy to "merge" in the dnsOpts loop above.

Moreover, ndots is treated (by libnetwork) as a boolean setting which changes resolver behavior.

This was introduced in e51268a:
e51268a

@joeabbey
Copy link

Hmm.. looks like no test case was added into that commit either

@fcrisciani
Copy link
Author

@joeabbey I created a patch, and will have to add some tests on top. Feel free to take a look and review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants