0

I configured the git proxy globally:

[https "https://github.com"]
    proxy = socks5://127.0.0.1:51837

However, when it was pushed to github, the connection was still abnormal. Through the opening log, I could see that although git uses socks proxy, it is resolved through the local dns, but the dns of github in my area was contaminated.

GIT_CURL_VERBOSE=1 GIT_TRACE=1 git push origin master

The problem has been solved by configuring the correct ip mapping in the hosts file. This should also be resolved by using a public dns.

But I still want to know how to configure the git socks proxy to use remote dns resolution?

Hccake
  • 11
  • 2
  • https://stackoverflow.com/a/63228830/7976758 Or use something like [Dnsmasq](https://thekelleys.org.uk/dnsmasq/doc.html). – phd Dec 15 '22 at 17:25
  • @phd Thanks for your answer, I found the solution in the corresponding comment section. Using 'socks5h' will use remote resolve, for example `git --config 'http.proxy=socks5h://127.0.0.1:4444'` – Hccake Dec 19 '22 at 02:47

1 Answers1

1

socks5h will use remote dns resolve, for example:

git --config 'http.proxy=socks5h://127.0.0.1:4444'

from stackoverflow.com/a/63228830/7976758 comments

Thanks @phd for the comment,

Hccake
  • 11
  • 2