{"thread":{"id":"34184","subject":"DNS issue when cloning over HTTP and HTTPS","startedAt":"2013-06-17T22:23:56Z","lastAt":"2013-06-17T23:11:05Z","messageCount":3,"participants":["LCD 47","Daniel Stenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"221109","messageId":"20130617222356.GA22255@admin.romednet.com","threadId":"34184","inReplyTo":null,"subject":"DNS issue when cloning over HTTP and HTTPS","fromName":"LCD 47","fromEmail":"lcd047@gmail.com","sentAt":"2013-06-17T22:23:56Z","receivedAt":"2013-06-17T22:23:56Z","isPatch":false,"sender":{"key":"lcd047@gmail.com","avatar":null},"body":"    The following snippet illustrates the problem:\n\n\n$ uname -srvm\nLinux 3.9.5-smp #2 SMP Mon Jun 10 02:54:26 CDT 2013 i686\n\n$ git --version\ngit version 1.8.3\n\n$ git clone https://github.com/torvalds/linux.git\nCloning into 'linux'...\nfatal: unable to access 'https://github.com/torvalds/linux.git/': Could not resolve host: github.com (Could not contact DNS servers)\n\n\n    Of course, DNS is working fine, and GitHub is accessible from my\nmachine:\n\n\n$ dig github.com\n\n; <<>> DiG 9.9.2-P2 <<>> github.com\n;; global options: +cmd\n;; Got answer:\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20305\n;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 1\n\n;; OPT PSEUDOSECTION:\n; EDNS: version: 0, flags:; udp: 4096\n;; QUESTION SECTION:\n;github.com.INA\n\n;; ANSWER SECTION:\ngithub.com.212INA204.232.175.90\n\n;; AUTHORITY SECTION:\ngithub.com.79055INNSns1.p16.dynect.net.\ngithub.com.79055INNSns2.p16.dynect.net.\ngithub.com.79055INNSns3.p16.dynect.net.\ngithub.com.79055INNSns4.p16.dynect.net.\n\n;; Query time: 0 msec\n;; SERVER: 192.168.7.2#53(192.168.7.2)\n;; WHEN: Tue Jun 18 00:46:13 2013\n;; MSG SIZE  rcvd: 141\n\n\n$ ping -c 3 github.com\nPING github.com (204.232.175.90) 56(84) bytes of data.\n64 bytes from github.com (204.232.175.90): icmp_req=1 ttl=52 time=142 ms\n64 bytes from github.com (204.232.175.90): icmp_req=2 ttl=52 time=140 ms\n64 bytes from github.com (204.232.175.90): icmp_req=3 ttl=52 time=154 ms\n\n--- github.com ping statistics ---\n3 packets transmitted, 3 received, 0% packet loss, time 2001ms\nrtt min/avg/max/mdev = 140.184/145.555/154.217/6.183 ms\n\n$ nc -v github.com https\ngithub.com [204.232.175.90] 443 (https) open\n^C\n\n\n    A packet capture shows what's going on:  Git tries to resolve\ngithub.com over LLMNR rather than DNS, and my router responds with\n\"destination unreachable\".  192.168.7.2 is my machine, and 192.168.7.1\nis my router:\n\n\nNo.     Time        Source                Destination           Length Expert Protocol Info\n      1 0.000000    192.168.7.2           192.168.7.1           70            LLMNR    Standard query 0xbfe4  A github.com\n\nFrame 1: 70 bytes on wire (560 bits), 70 bytes captured (560 bits)\nEthernet II, Src: IntelCor_94:18:a4 (00:1c:c0:94:18:a4), Dst: 22:4e:7f:5b:02:55 (22:4e:7f:5b:02:55)\nInternet Protocol Version 4, Src: 192.168.7.2 (192.168.7.2), Dst: 192.168.7.1 (192.168.7.1)\nUser Datagram Protocol, Src Port: 55585 (55585), Dst Port: 13568 (13568)\n    Source port: 55585 (55585)\n    Destination port: 13568 (13568)\n    Length: 36\n    Checksum: 0x8f89 [validation disabled]\n        [Good Checksum: False]\n        [Bad Checksum: False]\nLink-local Multicast Name Resolution (query)\n    Transaction ID: 0xbfe4\n    Flags: 0x0100 Standard query\n    Questions: 1\n    Answer RRs: 0\n    Authority RRs: 0\n    Additional RRs: 0\n    Queries\n        github.com: type A, class IN\n            Name: github.com\n            Type: A (Host address)\n            Class: IN (0x0001)\n\nNo.     Time        Source                Destination           Length Expert Protocol Info\n      2 0.000254    192.168.7.1           192.168.7.2           98            ICMP     Destination unreachable (Port unreachable)\n\nFrame 2: 98 bytes on wire (784 bits), 98 bytes captured (784 bits)\nEthernet II, Src: 22:4e:7f:5b:02:55 (22:4e:7f:5b:02:55), Dst: IntelCor_94:18:a4 (00:1c:c0:94:18:a4)\nInternet Protocol Version 4, Src: 192.168.7.1 (192.168.7.1), Dst: 192.168.7.2 (192.168.7.2)\nInternet Control Message Protocol\n    Type: 3 (Destination unreachable)\n    Code: 3 (Port unreachable)\n    Checksum: 0x8c86 [correct]\n    Internet Protocol Version 4, Src: 192.168.7.2 (192.168.7.2), Dst: 192.168.7.1 (192.168.7.1)\n    User Datagram Protocol, Src Port: 55585 (55585), Dst Port: 13568 (13568)\n        Source port: 55585 (55585)\n        Destination port: 13568 (13568)\n        Length: 36\n        Checksum: 0x9684 [validation disabled]\n            [Good Checksum: False]\n            [Bad Checksum: False]\n    Link-local Multicast Name Resolution (query)\n        Transaction ID: 0xbfe4\n        Flags: 0x0100 Standard query\n        Questions: 1\n        Answer RRs: 0\n        Authority RRs: 0\n        Additional RRs: 0\n        Queries\n            github.com: type A, class IN\n                Name: github.com\n                Type: A (Host address)\n                Class: IN (0x0001)\n\n\n    Cloning with the git protocol works as expected.\n\n    A search on the net shows people having the same problem more than\nan year ago, and the solution there seems to imply that Git can't cope\nwith async DNS in curl:\n\nhttp://osdir.com/ml/freebsd-ports-bugs/2012-05/msg00095.html\n\n    Any idea?\n\n    /lcd\n\nPS: Please CC me on replies, as I'm not subscribed to this list.\n"},{"id":"221110","messageId":"alpine.DEB.2.00.1306180038490.19414@tvnag.unkk.fr","threadId":"34184","inReplyTo":"20130617222356.GA22255@admin.romednet.com","subject":"Re: DNS issue when cloning over HTTP and HTTPS","fromName":"Daniel Stenberg","fromEmail":"daniel@haxx.se","sentAt":"2013-06-17T22:45:25Z","receivedAt":"2013-06-17T22:45:25Z","isPatch":false,"sender":{"key":"daniel@haxx.se","avatar":"https://gravatar.com/avatar/69fdca87edd17cee21ca2e79fc2ff671d644603c3dc27167430f3cd3dbab7ba8?d=mp&s=160"},"body":"On Tue, 18 Jun 2013, LCD 47 wrote:\n\n>    Cloning with the git protocol works as expected.\n>\n> A search on the net shows people having the same problem more than an year \n> ago, and the solution there seems to imply that Git can't cope with async \n> DNS in curl:\n>\n> http://osdir.com/ml/freebsd-ports-bugs/2012-05/msg00095.html\n>\n>    Any idea?\n\nIt's not a git problem really. When you build libcurl to use c-ares for asynch \nname resolving you unfortunately don't get a really feature complete \nreplacement for all stuff the stock synch resolver can do and I believe you \n(and person from that link from last year) experience that.\n\nThe solution for you is to:\n\na) rebuild libcurl with another resolving backend (there's a synch and \nthreaded asynch one to choose from)\n\n  or\n\nb) fix c-ares to work \"properly\" in this scenario as well\n\n-- \n\n  / daniel.haxx.se\n"},{"id":"221111","messageId":"20130617231105.GA24069@admin.romednet.com","threadId":"34184","inReplyTo":"alpine.DEB.2.00.1306180038490.19414@tvnag.unkk.fr","subject":"Re: DNS issue when cloning over HTTP and HTTPS","fromName":"LCD 47","fromEmail":"lcd047@gmail.com","sentAt":"2013-06-17T23:11:05Z","receivedAt":"2013-06-17T23:11:05Z","isPatch":false,"sender":{"key":"lcd047@gmail.com","avatar":null},"body":"On 18 June 2013, Daniel Stenberg <daniel@haxx.se> wrote:\n> On Tue, 18 Jun 2013, LCD 47 wrote:\n> \n> >   Cloning with the git protocol works as expected.\n> >\n> >A search on the net shows people having the same problem more than an\n> >year ago, and the solution there seems to imply that Git can't cope\n> >with async DNS in curl:\n> >\n> >http://osdir.com/ml/freebsd-ports-bugs/2012-05/msg00095.html\n> >\n> >   Any idea?\n> \n> It's not a git problem really. When you build libcurl to use c-ares\n> for asynch name resolving you unfortunately don't get a really feature\n> complete replacement for all stuff the stock synch resolver can do and\n> I believe you (and person from that link from last year) experience\n> that.\n>\n> The solution for you is to:\n>\n> a) rebuild libcurl with another resolving backend (there's a synch and\n> threaded asynch one to choose from)\n>\n>  or\n>\n> b) fix c-ares to work \"properly\" in this scenario as well\n\n    Thank you for the quick and very helpful response.  I rebuilt curl\nwith the threaded resolver, then I rebuilt Git, and now cloning over\nHTTP works fine.  I'll send a bug report to the maintainers of curl and\nGit for my Linux distribution then.\n\n    /lcd\n"}]}