{"action":"created","issue":{"url":"https://api.github.com/repos/moby/moby/issues/37816","repository_url":"https://api.github.com/repos/moby/moby","labels_url":"https://api.github.com/repos/moby/moby/issues/37816/labels{/name}","comments_url":"https://api.github.com/repos/moby/moby/issues/37816/comments","events_url":"https://api.github.com/repos/moby/moby/issues/37816/events","html_url":"https://github.com/moby/moby/issues/37816","id":358741930,"node_id":"MDU6SXNzdWUzNTg3NDE5MzA=","number":37816,"title":"Can't resolve same-network container names via DNS unless expilictly asking for IPv4-only.","user":{"login":"davidmatson","id":3360277,"node_id":"MDQ6VXNlcjMzNjAyNzc=","avatar_url":"https://avatars2.githubusercontent.com/u/3360277?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmatson","html_url":"https://github.com/davidmatson","followers_url":"https://api.github.com/users/davidmatson/followers","following_url":"https://api.github.com/users/davidmatson/following{/other_user}","gists_url":"https://api.github.com/users/davidmatson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmatson/subscriptions","organizations_url":"https://api.github.com/users/davidmatson/orgs","repos_url":"https://api.github.com/users/davidmatson/repos","events_url":"https://api.github.com/users/davidmatson/events{/privacy}","received_events_url":"https://api.github.com/users/davidmatson/received_events","type":"User","site_admin":false},"labels":[{"id":73616520,"node_id":"MDU6TGFiZWw3MzYxNjUyMA==","url":"https://api.github.com/repos/moby/moby/labels/area/builder","name":"area/builder","color":"fbca04","default":false},{"id":237472034,"node_id":"MDU6TGFiZWwyMzc0NzIwMzQ=","url":"https://api.github.com/repos/moby/moby/labels/area/networking","name":"area/networking","color":"fbca04","default":false},{"id":161101581,"node_id":"MDU6TGFiZWwxNjExMDE1ODE=","url":"https://api.github.com/repos/moby/moby/labels/platform/windows","name":"platform/windows","color":"F6FBFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-10T18:32:48Z","updated_at":"2018-09-10T18:33:29Z","closed_at":null,"author_association":"NONE","body":"On Windows Server, version 1803, a normal DNS request to resolve another container name in the same network fails. This appears to be a problem with IPv6 addresses assumed to be asked for by default but unable to be provided. Specifically, starting in 1803, DNS resolution of another container name in the same network fails in .NET using GetHostEntry/GetHostAddresses.\r\n\r\nFrom a native code standpoint, gethostbyname works, but getaddrinfo no longer works if called normally with AF_UNSPEC; it only works if set explicitly to AF_INET6. Otherwise, it returns WSAHOST_NOT_FOUND.\r\n\r\nSee attached for repro source code.\r\n\r\n**Steps to reproduce the issue:**\r\n1. docker network create -d nat samplenat\r\n2. docker run -d -p 80:80 --network samplenat -h httpserver http-hello-world\r\n3. docker run --network samplenat microsoft/windowsservercore:1803 powershell invoke-restmethod http://httpserver\r\n\r\nDockerfile for http-hello-world:\r\n```\r\nFROM microsoft/windowsservercore:1803\r\n# Based on https://gist.github.com/willurd/5720255\r\nENTRYPOINT [\"powershell.exe\", \"-Command\", \"$l=New-Object Net.HttpListener;$l.Prefixes.Add('http://+:80/');$l.Start();While ($l.IsListening){$c=$l.GetContext();$r=$c.Response;$r.Headers.Add('Content-Type','text/plain');$b=[Text.Encoding]::UTF8.GetBytes('Hello, World');$r.ContentLength64=$b.Length;$r.OutputStream.Write($b,0,$b.Length);$r.Close()};$l.Stop()\"]\r\nEXPOSE 80\r\n```\r\n\r\n**Describe the results you received:**\r\ninvoke-restmethod : The remote name could not be resolved: 'httpserver'\r\n\r\n**Describe the results you expected:**\r\nHello, World\r\n\r\n**Additional information you deem important (e.g. issue happens only occasionally):**\r\nOn Windows 10, version 1803, the problem happens only intermittently. On Windows Server, version 1803, it appears to happen every time.\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\nClient:\r\n Version:           18.03.1-ee-3\r\n API version:       1.37\r\n Go version:        go1.10.2\r\n Git commit:        b9a5c95\r\n Built:             Thu Aug 30 18:42:35 2018\r\n OS/Arch:           windows/amd64\r\n Experimental:      false\r\n\r\nServer:\r\n Engine:\r\n  Version:          18.03.1-ee-3\r\n  API version:      1.37 (minimum version 1.24)\r\n  Go version:       go1.10.2\r\n  Git commit:       b9a5c95\r\n  Built:            Thu Aug 30 18:56:49 2018\r\n  OS/Arch:          windows/amd64\r\n  Experimental:     false\r\n```\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\nContainers: 7\r\n Running: 0\r\n Paused: 0\r\n Stopped: 7\r\nImages: 3\r\nServer Version: 18.03.1-ee-3\r\nStorage Driver: windowsfilter\r\n Windows:\r\nLogging Driver: json-file\r\nPlugins:\r\n Volume: local\r\n Network: ics l2bridge l2tunnel nat null overlay transparent\r\n Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog\r\nSwarm: inactive\r\nDefault Isolation: process\r\nKernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)\r\nOperating System: Windows Server Datacenter Version 1803 (OS Build 17134.228)\r\nOSType: windows\r\nArchitecture: x86_64\r\nCPUs: 8\r\nTotal Memory: 5.998GiB\r\nName: dmatson-2010\r\nID: MGCQ:VLDM:TI5O:744R:XNJA:G54Z:MJ32:WEHN:B2AP:YIEO:XVKF:H56W\r\nDocker Root Dir: C:\\ProgramData\\docker\r\nDebug Mode (client): false\r\nDebug Mode (server): false\r\nRegistry: https://index.docker.io/v1/\r\nLabels:\r\nExperimental: false\r\nInsecure Registries:\r\n 127.0.0.0/8\r\nLive Restore Enabled: false\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\nPhysical\r\n"},"comment":{"url":"https://api.github.com/repos/moby/moby/issues/comments/420015291","html_url":"https://github.com/moby/moby/issues/37816#issuecomment-420015291","issue_url":"https://api.github.com/repos/moby/moby/issues/37816","id":420015291,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDAxNTI5MQ==","user":{"login":"davidmatson","id":3360277,"node_id":"MDQ6VXNlcjMzNjAyNzc=","avatar_url":"https://avatars2.githubusercontent.com/u/3360277?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmatson","html_url":"https://github.com/davidmatson","followers_url":"https://api.github.com/users/davidmatson/followers","following_url":"https://api.github.com/users/davidmatson/following{/other_user}","gists_url":"https://api.github.com/users/davidmatson/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmatson/subscriptions","organizations_url":"https://api.github.com/users/davidmatson/orgs","repos_url":"https://api.github.com/users/davidmatson/repos","events_url":"https://api.github.com/users/davidmatson/events{/privacy}","received_events_url":"https://api.github.com/users/davidmatson/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T18:33:29Z","updated_at":"2018-09-10T18:33:29Z","author_association":"NONE","body":"Native repro code (client side):\r\n```\r\n// Minimally modified from:\r\n// https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo\r\n\r\n#undef UNICODE\r\n#include <winsock2.h>\r\n#include <ws2tcpip.h>\r\n#include <stdio.h>\r\n\r\n// link with Ws2_32.lib\r\n#pragma comment (lib, \"Ws2_32.lib\")\r\n\r\nint __cdecl main(int argc, char **argv)\r\n{\r\n\r\n        //-----------------------------------------\r\n        // Declare and initialize variables\r\n        WSADATA wsaData;\r\n    int iResult;\r\n\r\n    DWORD dwRetval;\r\n\r\n    int i = 1;\r\n\r\n    struct addrinfo *result = NULL;\r\n    struct addrinfo *ptr = NULL;\r\n    struct addrinfo hints;\r\n\r\n\r\n    // Validate the parameters\r\n    if (argc != 2) {\r\n        printf(\"usage: %s <IP Address String>\\n\", argv[0]);\r\n        printf(\"  getaddrinfo determines the IP binary network address\\n\");\r\n        printf(\"       %s 207.46.197.32\\n\", argv[0]);  /* www.contoso.com */\r\n        return 1;\r\n    }\r\n    // Initialize Winsock\r\n    iResult = WSAStartup(MAKEWORD(2, 2), & wsaData);\r\n    if (iResult != 0) {\r\n        printf(\"WSAStartup failed: %d\\n\", iResult);\r\n        return 1;\r\n    }\r\n\r\n    //--------------------------------\r\n    // Setup the hints address info structure\r\n    // which is passed to the getaddrinfo() function\r\n    ZeroMemory(& hints, sizeof(hints));\r\n    hints.ai_flags = AI_CANONNAME;\r\n    hints.ai_family = AF_UNSPEC; // AF_INET works\r\n\r\n    //    hints.ai_socktype = SOCK_STREAM;\r\n    //    hints.ai_protocol = IPPROTO_TCP;\r\n\r\n    //--------------------------------\r\n    // Call getaddrinfo(). If the call succeeds,\r\n    // the result variable will hold a linked list\r\n    // of addrinfo structures containing response\r\n    // information\r\n    dwRetval = getaddrinfo(argv[1], NULL, &hints, &result);\r\n    if (dwRetval != 0) {\r\n        printf(\"getaddrinfo failed with error: %d\\n\", dwRetval);\r\n        WSACleanup();\r\n        return 1;\r\n    }\r\n\r\n        printf(\"getaddrinfo returned success\\n\");\r\n\r\n    // Retrieve each address and print out the hex bytes\r\n    for (ptr = result; ptr != NULL; ptr = ptr -> ai_next) {\r\n\r\n        printf(\"getaddrinfo response %d\\n\", i++);\r\n        printf(\"\\tFlags: 0x%x\\n\", ptr -> ai_flags);\r\n        printf(\"\\tFamily: \");\r\n        switch (ptr -> ai_family) {\r\n        case AF_UNSPEC:\r\n            printf(\"Unspecified\\n\");\r\n            break;\r\n        case AF_INET:\r\n            printf(\"AF_INET (IPv4)\\n\");\r\n            break;\r\n        case AF_INET6:\r\n            printf(\"AF_INET6 (IPv6)\\n\");\r\n            break;\r\n        case AF_NETBIOS:\r\n            printf(\"AF_NETBIOS (NetBIOS)\\n\");\r\n            break;\r\n        default:\r\n            printf(\"Other %ld\\n\", ptr -> ai_family);\r\n            break;\r\n        }\r\n        printf(\"\\tSocket type: \");\r\n        switch (ptr -> ai_socktype) {\r\n        case 0:\r\n            printf(\"Unspecified\\n\");\r\n            break;\r\n        case SOCK_STREAM:\r\n            printf(\"SOCK_STREAM (stream)\\n\");\r\n            break;\r\n        case SOCK_DGRAM:\r\n            printf(\"SOCK_DGRAM (datagram) \\n\");\r\n            break;\r\n        case SOCK_RAW:\r\n            printf(\"SOCK_RAW (raw) \\n\");\r\n            break;\r\n        case SOCK_RDM:\r\n            printf(\"SOCK_RDM (reliable message datagram)\\n\");\r\n            break;\r\n        case SOCK_SEQPACKET:\r\n            printf(\"SOCK_SEQPACKET (pseudo-stream packet)\\n\");\r\n            break;\r\n        default:\r\n            printf(\"Other %ld\\n\", ptr -> ai_socktype);\r\n            break;\r\n        }\r\n        printf(\"\\tProtocol: \");\r\n        switch (ptr -> ai_protocol) {\r\n        case 0:\r\n            printf(\"Unspecified\\n\");\r\n            break;\r\n        case IPPROTO_TCP:\r\n            printf(\"IPPROTO_TCP (TCP)\\n\");\r\n            break;\r\n        case IPPROTO_UDP:\r\n            printf(\"IPPROTO_UDP (UDP) \\n\");\r\n            break;\r\n        default:\r\n            printf(\"Other %ld\\n\", ptr -> ai_protocol);\r\n            break;\r\n        }\r\n        printf(\"\\tLength of this sockaddr: %d\\n\", ptr -> ai_addrlen);\r\n        printf(\"\\tCanonical name: %s\\n\", ptr -> ai_canonname);\r\n    }\r\n\r\n    freeaddrinfo(result);\r\n    WSACleanup();\r\n\r\n    return 0;\r\n\r\n}\r\n```"}}
{"actor":{"display_login":"davidmatson"}}