{"action":"created","issue":{"url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/7","labels_url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/7/comments","events_url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/7/events","html_url":"https://github.com/tonistiigi/dnsdock/issues/7","id":55174955,"number":7,"title":"can not resolve host names","user":{"login":"Vad1mo","id":1492007,"avatar_url":"https://avatars.githubusercontent.com/u/1492007?v=3","gravatar_id":"","url":"https://api.github.com/users/Vad1mo","html_url":"https://github.com/Vad1mo","followers_url":"https://api.github.com/users/Vad1mo/followers","following_url":"https://api.github.com/users/Vad1mo/following{/other_user}","gists_url":"https://api.github.com/users/Vad1mo/gists{/gist_id}","starred_url":"https://api.github.com/users/Vad1mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vad1mo/subscriptions","organizations_url":"https://api.github.com/users/Vad1mo/orgs","repos_url":"https://api.github.com/users/Vad1mo/repos","events_url":"https://api.github.com/users/Vad1mo/events{/privacy}","received_events_url":"https://api.github.com/users/Vad1mo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-22T16:32:39Z","updated_at":"2015-02-19T13:59:51Z","closed_at":"2015-02-19T13:59:51Z","body":"I am using https://vagrantcloud.com/yungsang/boxes/boot2docker with two modifications \r\n\r\n```\r\n  config.vm.provider \"virtualbox\" do |v|\r\n    v.memory = 2048\r\n    v.cpus = 4\r\n    v.customize [\"modifyvm\", :id, \"--nicpromisc2\", \"allow-all\"]\r\n  end\r\n\r\n  config.vm.network \"private_network\", ip: \"192.168.10.11\"\r\n```\r\n\r\nI added the needed entries for the docker daemon `config.vm.provision :shell, inline: \"echo EXTRA_ARGS='--bip=172.17.42.1/16 --dns 172.17.42.1' > /var/lib/boot2docker/profile && cat /var/lib/boot2docker/profile\"`\r\n\r\nand started dnsdock\r\n```\r\n  config.vm.provision :docker do |d|\r\n    d.run \"dnsdock\",\r\n      image: \"tonistiigi/dnsdock\",\r\n      args: \"--name dnsdock -v /var/run/docker.sock:/var/run/docker.sock -p 172.17.42.1:53:53/udp -p 8080:80\"\r\n```\r\n\r\nWhen I call  dig *.docker from inside an container e.g. zservice I get nothing until I add @172.17.42.1 \r\nWhat I also see is that there is this nameserver in the zservice container.\r\n```\r\nroot@z-service:/# cat /etc/resolv.conf\r\nnameserver 10.0.2.3\r\nroot@z-service:/# dig @172.17.42.1 docker\r\n\r\n; <<>> DiG 9.9.5-8-Debian <<>> @172.17.42.1 docker\r\n; (1 server found)\r\n;; global options: +cmd\r\n;; Got answer:\r\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57080\r\n;; flags: qr rd; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0\r\n;; WARNING: recursion requested but not available\r\n\r\n;; QUESTION SECTION:\r\n;docker.\t\t\t\tIN\tA\r\n\r\n;; ANSWER SECTION:\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.157\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.158\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.159\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.160\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.161\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.164\r\ndocker.\t\t\t0\tIN\tA\t172.17.0.156\r\n\r\n;; Query time: 6 msec\r\n;; SERVER: 172.17.42.1#53(172.17.42.1)\r\n;; WHEN: Thu Jan 22 16:24:35 UTC 2015\r\n;; MSG SIZE  rcvd: 178\r\n\r\nroot@z-service:/# \r\n```\r\nAm I right that there should be the Ip Adress of DNSdock or the one of the gateway 172.17.42.1. \r\nSo I wonder why is the nameserver not set correctly in the container?\r\n```\r\n    \"NetworkSettings\": {\r\n        \"Bridge\": \"docker0\",\r\n        \"Gateway\": \"172.17.42.1\",\r\n        \"IPAddress\": \"172.17.0.160\",\r\n        \"IPPrefixLen\": 16,\r\n        \"MacAddress\": \"02:42:ac:11:00:a0\",\r\n        \"PortMapping\": null,\r\n        \"Ports\": {\r\n            \"8884/tcp\": [\r\n                {\r\n                    \"HostIp\": \"0.0.0.0\",\r\n                    \"HostPort\": \"8884\"\r\n                }\r\n            ]\r\n        }\r\n    },\r\n```"},"comment":{"url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/comments/75055660","html_url":"https://github.com/tonistiigi/dnsdock/issues/7#issuecomment-75055660","issue_url":"https://api.github.com/repos/tonistiigi/dnsdock/issues/7","id":75055660,"user":{"login":"Vad1mo","id":1492007,"avatar_url":"https://avatars.githubusercontent.com/u/1492007?v=3","gravatar_id":"","url":"https://api.github.com/users/Vad1mo","html_url":"https://github.com/Vad1mo","followers_url":"https://api.github.com/users/Vad1mo/followers","following_url":"https://api.github.com/users/Vad1mo/following{/other_user}","gists_url":"https://api.github.com/users/Vad1mo/gists{/gist_id}","starred_url":"https://api.github.com/users/Vad1mo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vad1mo/subscriptions","organizations_url":"https://api.github.com/users/Vad1mo/orgs","repos_url":"https://api.github.com/users/Vad1mo/repos","events_url":"https://api.github.com/users/Vad1mo/events{/privacy}","received_events_url":"https://api.github.com/users/Vad1mo/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T13:59:51Z","updated_at":"2015-02-19T13:59:51Z","body":"I tried it again and now it works. \r\n\r\n```\r\nresolver 172.17.42.1; #use dnsdock to resolve hostname to IPs dynamically TTL is set by Dnsdock\r\nresolver_timeout 10s;\r\nserver {\r\n  listen 80;\r\n  server_name ${HOSTNAME};\r\n\r\n  location / {\r\n    autoindex on;\r\n    root  /app/zwebapp/;\r\n  }\r\n  location /api/ {      \r\n      set $backend zservice.docker;\r\n      proxy_pass              http://$backend:8884;      \r\n     ....\r\n``"}}