Skip to content
MtrXTools

fatal: unable to access '...': Could not resolve host: github.com

Git can't resolve the remote's hostname

Seen in git over HTTPS, CI runners, Docker builds

Git could not turn the remote's hostname into an IP address, so it never reached the server.

Common causes

  • No working DNS: offline, captive Wi-Fi portal, VPN that changed resolvers, or a container with a broken resolv.conf.
  • A typo in the remote URL or a hostname that only resolves on an internal network.
  • A proxy is required but git is not configured to use it.

How to fix it

  1. Check the remote URL with git remote -v and correct it with git remote set-url origin <url>.
  2. Test name resolution outside git, e.g. nslookup github.com.
  3. If you need a proxy, set it: git config --global http.proxy http://proxy.example.com:8080.
Check the hostname resolves

Got a different message? Paste it into the error explainer.

Related errors

All 31 Dev tools & SSH errors