fatal: unable to access '...': Could not resolve host
Git’s “fatal: unable to access: Could not resolve host” means your system can’t convert the repository hostname into an IP address — DNS resolution failed entirely.
What It Means
When you run git clone, git fetch, or git push, Git first needs to resolve the hostname to an IP address via DNS (Domain Name System). If DNS resolution fails, Git can’t connect at all — no TCP connection is even attempted. The error is purely about hostname resolution, not authentication or protocol issues. This is almost always a network configuration problem at the OS level.
Why It Happens
- No internet connection — you’re offline or the network is down.
- DNS server is unavailable or misconfigured on your system.
- A VPN or corporate network blocks external DNS lookups.
- Git is configured with an HTTP/HTTPS proxy that’s unreachable.
- The hostname is misspelled in the Git remote URL.
- The remote server (GitHub, GitLab, Bitbucket) is temporarily down.
How to Fix It
Step 1: Check your internet connection
ping -c 3 8.8.8.8
# If this works but github.com doesn't, it's a DNS issueStep 2: Test DNS resolution
nslookup github.com
# Or
dig github.comIf these fail, configure a public DNS server like Google DNS (8.8.8.8) or Cloudflare (1.1.1.1).
Step 3: Check Git proxy configuration
A misconfigured proxy can block hostname resolution:
git config --global --get http.proxy
git config --global --get https.proxyIf a proxy is set and shouldn’t be, remove it:
git config --global --unset http.proxy
git config --global --unset https.proxyStep 4: Verify the remote URL
git remote -v
# Check for typos: github.co instead of github.com
git remote set-url origin https://github.com/user/repo.gitStep 5: Temporarily disable VPN or firewall
If you’re behind a VPN, try disconnecting and testing again:
# Disconnect VPN, then test
ping github.com
git fetchStep 6: Flush DNS cache
On Linux:
sudo systemd-resolve --flush-caches
# Or
sudo resolvectl flush-cachesOn macOS:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponderOn Windows:
ipconfig /flushdnsBuilt by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro