Curl, git, other commands hang while trying to download file on Ubuntu 18
by Sbrizzu from LinuxQuestions.org on (#4SQ05)
Currently on Ubuntu 18.04.12, when I try to download something from the terminal, or push to git or any similar command it always hangs on the download either indefinitely or for a very long time. However when I Ctrl+C and try again it usually works after a couple of tries.
I was able to diagnose a bit and the hanging happens when curl tries to resolve the ipv6 address of the server instead of the ipv4. Problem is, I don't have ipv6 configured or an ipv6 DNS server setup for that matter, so I'm really lost why it would try that (or at least why it would try that so many times and not revert back to ipv4). I disabled ipv6 with sysctl but it doesn't make a difference.
I'm a bit lost here since this doesn't seem to happen on other machines in the same network, but I believe this one is the only one with Ubuntu 18.


I was able to diagnose a bit and the hanging happens when curl tries to resolve the ipv6 address of the server instead of the ipv4. Problem is, I don't have ipv6 configured or an ipv6 DNS server setup for that matter, so I'm really lost why it would try that (or at least why it would try that so many times and not revert back to ipv4). I disabled ipv6 with sysctl but it doesn't make a difference.
I'm a bit lost here since this doesn't seem to happen on other machines in the same network, but I believe this one is the only one with Ubuntu 18.