Error messages
Git: “Could not resolve host: github.com” on Mac
Git could not get an address for github.com. For HTTPS remotes, Git prints curl's message. For SSH remotes, ssh prints its own message.
Symptoms
- Git shows
fatal: unable to access 'https://github.com/…/': Could not resolve host: github.com. - With an SSH remote, ssh shows
Could not resolve hostname github.com: nodename nor servname provided, or not known. git clone,git pullandgit pushall fail.
Likely causes
- No connection or no DNS. The Mac cannot look up any name.
- A proxy that Git does not use. On a network that needs a proxy, Git needs
http.proxyor proxy variables. - A VPN or DNS filter. A VPN's DNS server or a filter can fail to answer for github.com.
- A wrong remote URL. A typing error in the remote gives a name that does not exist.
How to check
Show the remote URLs of the repository.
git remote -vLook up github.com through the macOS resolver.
dscacheutil -q host -a name github.comShow Git's proxy setting and your proxy variables.
git config --get http.proxy env | grep -i proxyTest the HTTPS path with curl.
curl -I https://github.com
How to fix it
If the lookup fails for every name, fix DNS. See DNS not resolving on a Mac.
If the network needs a proxy, set it for Git.
git config --global http.proxy http://proxy.example.com:8080If an old proxy setting is wrong, remove it.
git config --global --unset http.proxyCorrect the remote URL if it has a typing error.
git remote set-url origin https://github.com/OWNER/REPO.git
With Kilobat
Kilobat's connection doctor tests the host layer by layer: network, proxy, DNS, rules, IPv4, IPv6, TLS and the server. It names the layer that failed.
kilobat why github.comThese Kilobat checks are free. AI agents run them through MCP with
diagnose_connectionanddiagnose_network. See Find why one site or API won't connect.
Questions
Is GitHub down?
Maybe, but a lookup error is usually local. If dscacheutil finds other names but not github.com, look at your DNS or filter.
Sources
- curl: libcurl error codes
- git-config(1), http.proxy, man page installed with macOS 27.2 (Git 2.56)
- ssh(1) and dscacheutil(1), man page installed with macOS 27.2
Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.