{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/17195","labels_url":"https://api.github.com/repos/docker/docker/issues/17195/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/17195/comments","events_url":"https://api.github.com/repos/docker/docker/issues/17195/events","html_url":"https://github.com/docker/docker/issues/17195","id":112269176,"number":17195,"title":"Proposal: docker embedded DNS server","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/networking","name":"group/networking","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":45,"created_at":"2015-10-20T01:59:14Z","updated_at":"2015-11-19T11:12:47Z","closed_at":null,"body":"There are numerous open issues in regards to docker and DNS handling within containers: (#17190 #16619 #15978 #14627 #15819 and likely many others which I was fuzzy on)\r\n\r\nOne solution I think which would solve all these issues would be if docker acted as a DNS server. It would answer lookup requests for linked containers, and when the request isn't for a linked container, it would forward it upstream (to the host's name servers).\r\n\r\nThe `/etc/hosts` file inside the container would then be static, containing only the container itself.\r\nWe could also not touch `/etc/hosts` at all, and leave the container's entry to DNS. This would allow image builds to manipulate the file and persist the changes.\r\n\r\nFor performance, it would probably be good if docker cached the upstream DNS records. Records come back with a TTL, so docker should cache the record until this TTL expires."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/158025599","html_url":"https://github.com/docker/docker/issues/17195#issuecomment-158025599","issue_url":"https://api.github.com/repos/docker/docker/issues/17195","id":158025599,"user":{"login":"aidanhs","id":1050652,"avatar_url":"https://avatars.githubusercontent.com/u/1050652?v=3","gravatar_id":"","url":"https://api.github.com/users/aidanhs","html_url":"https://github.com/aidanhs","followers_url":"https://api.github.com/users/aidanhs/followers","following_url":"https://api.github.com/users/aidanhs/following{/other_user}","gists_url":"https://api.github.com/users/aidanhs/gists{/gist_id}","starred_url":"https://api.github.com/users/aidanhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidanhs/subscriptions","organizations_url":"https://api.github.com/users/aidanhs/orgs","repos_url":"https://api.github.com/users/aidanhs/repos","events_url":"https://api.github.com/users/aidanhs/events{/privacy}","received_events_url":"https://api.github.com/users/aidanhs/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T11:12:46Z","updated_at":"2015-11-19T11:12:46Z","body":"The problem with that is that go binaries (a popular choice for creating stripped down docker containers) don't look at nsswitch.conf because they're typically statically compiled and can't load the shared libraries.\r\nEven if go binaries could load shared libs, nsswitch.conf wouldn't work in single binary containers anyway because libc isn't present (and won't work in alpine by default because it uses musl, which doesn't respect nsswitch).\r\n\r\nConcrete example of nsswitch.conf being ignored by a go binary we're all familiar with: https://github.com/docker/docker/issues/1715\r\n\r\nI do like the idea. But the current 'docker best practices' and ecosystem of containers means that this probably isn't even an 80% solution."}}