{"action":"created","issue":{"url":"https://api.github.com/repos/docker/machine/issues/2055","labels_url":"https://api.github.com/repos/docker/machine/issues/2055/labels{/name}","comments_url":"https://api.github.com/repos/docker/machine/issues/2055/comments","events_url":"https://api.github.com/repos/docker/machine/issues/2055/events","html_url":"https://github.com/docker/machine/issues/2055","id":112752033,"number":2055,"title":"5000ms are added to all requests done using a local hostname from /etc/hosts - running on OSX","user":{"login":"motin","id":793037,"avatar_url":"https://avatars.githubusercontent.com/u/793037?v=3","gravatar_id":"","url":"https://api.github.com/users/motin","html_url":"https://github.com/motin","followers_url":"https://api.github.com/users/motin/followers","following_url":"https://api.github.com/users/motin/following{/other_user}","gists_url":"https://api.github.com/users/motin/gists{/gist_id}","starred_url":"https://api.github.com/users/motin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motin/subscriptions","organizations_url":"https://api.github.com/users/motin/orgs","repos_url":"https://api.github.com/users/motin/repos","events_url":"https://api.github.com/users/motin/events{/privacy}","received_events_url":"https://api.github.com/users/motin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-22T08:15:53Z","updated_at":"2015-10-22T18:23:56Z","closed_at":"2015-10-22T18:23:56Z","body":"Using docker-machine 1.4.2 (migrated from boot2docker using the Docker toolbox installer) and experiencing a 5000ms extra latency on all requests done using a local hostname from /etc/hosts. \r\n\r\nSteps to reproduce:\r\n\r\nUse the following docker-compose.yml:\r\n\r\n    web:\r\n      image: tutum/hello-world\r\n      ports:\r\n        - \"80\"\r\n\r\nAdd to /etc/hosts locally:\r\n\r\n    192.168.99.100 docker.local\r\n\r\nFire up the stack and make a request from outside the docker machine:\r\n\r\n    $ docker-compose up -d\r\n    Starting 5000mslatency_web_1...\r\n    $ docker-compose ps\r\n           Name                      Command               State           Ports\r\n    ------------------------------------------------------------------------------------\r\n    5000mslatency_web_1   /bin/sh -c php-fpm -d vari ...   Up      0.0.0.0:32897->80/tcp\r\n    $ date && time curl -v http://docker.local:32897/\r\n    Tor 22 Okt 2015 10:12:17 CEST\r\n    *   Trying 192.168.99.100...\r\n    * Connected to docker.local (192.168.99.100) port 32897 (#0)\r\n    > GET / HTTP/1.1\r\n    > Host: docker.local:32897\r\n    > User-Agent: curl/7.44.0\r\n    > Accept: */*\r\n    >\r\n    < HTTP/1.1 200 OK\r\n    < Server: nginx/1.6.2\r\n    < Date: Thu, 22 Oct 2015 08:12:22 GMT\r\n    < Content-Type: text/html; charset=UTF-8\r\n    < Transfer-Encoding: chunked\r\n    < Connection: keep-alive\r\n    < X-Powered-By: PHP/5.6.8\r\n    <\r\n    <html>\r\n    <head>\r\n        <title>Hello world!</title>\r\n        <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>\r\n        <style>\r\n        body {\r\n            background-color: white;\r\n            text-align: center;\r\n            padding: 50px;\r\n            font-family: \"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;\r\n        }\r\n\r\n        #logo {\r\n            margin-bottom: 40px;\r\n        }\r\n        </style>\r\n    </head>\r\n    <body>\r\n        <img id=\"logo\" src=\"logo.png\" />\r\n        <h1>Hello world!</h1>\r\n        <h3>My hostname is 86b59404553c</h3>\t</body>\r\n    </html>\r\n    * Connection #0 to host docker.local left intact\r\n\r\n    real\t0m5.038s\r\n    user\t0m0.004s\r\n    sys\t0m0.005s\r\n\r\nThen, run it directly against the IP and see that there is no 5000ms latency:\r\n\r\n    $ date && time curl -v http://192.168.99.100:32897/\r\n    Tor 22 Okt 2015 10:32:51 CEST\r\n    *   Trying 192.168.99.100...\r\n    * Connected to 192.168.99.100 (192.168.99.100) port 32897 (#0)\r\n    > GET / HTTP/1.1\r\n    > Host: 192.168.99.100:32897\r\n    > User-Agent: curl/7.44.0\r\n    > Accept: */*\r\n    >\r\n    < HTTP/1.1 200 OK\r\n    < Server: nginx/1.6.2\r\n    < Date: Thu, 22 Oct 2015 08:32:51 GMT\r\n    < Content-Type: text/html; charset=UTF-8\r\n    < Transfer-Encoding: chunked\r\n    < Connection: keep-alive\r\n    < X-Powered-By: PHP/5.6.8\r\n    <\r\n    <html>\r\n    <head>\r\n      <title>Hello world!</title>\r\n      <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>\r\n      <style>\r\n      body {\r\n        background-color: white;\r\n        text-align: center;\r\n        padding: 50px;\r\n        font-family: \"Open Sans\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;\r\n      }\r\n    \r\n      #logo {\r\n        margin-bottom: 40px;\r\n      }\r\n      </style>\r\n    </head>\r\n    <body>\r\n      <img id=\"logo\" src=\"logo.png\" />\r\n      <h1>Hello world!</h1>\r\n      <h3>My hostname is 86b59404553c</h3>\t</body>\r\n    </html>\r\n    * Connection #0 to host 192.168.99.100 left intact\r\n    \r\n    real\t0m0.011s\r\n    user\t0m0.003s\r\n    sys\t0m0.003s\r\n\r\nWhen running from inside the docker-machine, there is no extra latency, with or without a local hostname in the query."},"comment":{"url":"https://api.github.com/repos/docker/machine/issues/comments/150313265","html_url":"https://github.com/docker/machine/issues/2055#issuecomment-150313265","issue_url":"https://api.github.com/repos/docker/machine/issues/2055","id":150313265,"user":{"login":"nathanleclaire","id":1476820,"avatar_url":"https://avatars.githubusercontent.com/u/1476820?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanleclaire","html_url":"https://github.com/nathanleclaire","followers_url":"https://api.github.com/users/nathanleclaire/followers","following_url":"https://api.github.com/users/nathanleclaire/following{/other_user}","gists_url":"https://api.github.com/users/nathanleclaire/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanleclaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanleclaire/subscriptions","organizations_url":"https://api.github.com/users/nathanleclaire/orgs","repos_url":"https://api.github.com/users/nathanleclaire/repos","events_url":"https://api.github.com/users/nathanleclaire/events{/privacy}","received_events_url":"https://api.github.com/users/nathanleclaire/received_events","type":"User","site_admin":false},"created_at":"2015-10-22T18:23:56Z","updated_at":"2015-10-22T18:23:56Z","body":"Since the issue doesn't seem related to Machine (other hostnames work fine), I'm closing this."}}