fatal: unable to access <link> getaddrinfo() thread failed to start

I had the same problem, I tried several solutions until I found out that in my case it was the firewall. Mine was the "Free Firewall", I noticed that even authorizing the software and connections it was still not possible to have a connection to the remote repository. I disabled it and it didn't solve it, only when I uninstalled it that the problem was solved and I was able to use Git normally.


Same issue on my machine (git version 2.28.0.windows.1). The problem seems to be related to DNS resolution of HTTP-requests:

This was my original remote url:

git remote set-url origin http://<FQDN>:<http_port>/<repository>.git

With the same result as in the question:

$ git pull
fatal: unable to access 'http://<FQDN>:<http_port>/<repository>.git/': getaddrinfo() thread failed to start

When changing the URL to the resolved IP:

$ ahost <FQDN>
<FQDN>                               <IP>

$ git remote set-url origin http://<IP>:<http_port>/<repository>.git

Git connects without issue:

$ git pull
Already up to date.

Also, when using SSH instead of HTTP there is no issue with the resolution:

$ git remote set-url origin ssh://<username>@<FQDN>:<ssh_port>/<repository>.git
$ git pull
Already up to date.

Curl also doesn't work in my MINGW64 environment:

$ ahost www.google.com
www.google.com                          172.217.2.100
    
$ adig www.google.com
id: 64322
flags: qr rd ra
opcode: QUERY
rcode: NOERROR
Questions:
        www.google.com .                A
Answers:
        www.google.com .        49      A       172.217.2.100
NS records:
Additional records:


$ curl www.google.com -v
* getaddrinfo() thread failed to start

* Couldn't resolve host 'www.google.com'
* Closing connection 0
curl: (6) getaddrinfo() thread failed to start