---
title: "Git Could not resolve host: github.com on Mac: fix it · Kilobat Guides"
url: "https://kilobat.app/guides/git-could-not-resolve-host-github.html"
description: "git clone or git push on your Mac fails with Could not resolve host: github.com. Check DNS, the proxy and the remote URL, then fix the lookup."
---

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.

Applies to: Git that macOS or Homebrew installs, on all current macOS versions. The text was checked with Git 2.56 and OpenSSH 10.5. · Checked: 29 October 2026

## 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 pull` and `git push` all 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.proxy` or 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

1. Show the remote URLs of the repository.

   ```
   git remote -v
   ```
2. Look up github.com through the macOS resolver.

   ```
   dscacheutil -q host -a name github.com
   ```
3. Show Git's proxy setting and your proxy variables.

   ```
   git config --get http.proxy
   env | grep -i proxy
   ```
4. Test the HTTPS path with curl.

   ```
   curl -I https://github.com
   ```

## How to fix it

1. If the lookup fails for every name, fix DNS. See [DNS not resolving on a Mac](https://kilobat.app/guides/dns-server-not-found.html).
2. If the network needs a proxy, set it for Git.

   ```
   git config --global http.proxy http://proxy.example.com:8080
   ```
3. If an old proxy setting is wrong, remove it.

   ```
   git config --global --unset http.proxy
   ```
4. Correct the remote URL if it has a typing error.

   ```
   git remote set-url origin https://github.com/OWNER/REPO.git
   ```

## With Kilobat

1. 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.com
   ```
2. These Kilobat checks are free. AI agents run them through MCP with `diagnose_connection` and `diagnose_network`. See [Find why one site or API won't connect](https://kilobat.app/guides/recipes/why-cant-it-connect.html).

## 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](https://curl.se/libcurl/c/libcurl-errors.html)
- 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.

## Related guides

- [“curl: (6) Could not resolve host” on Mac](https://kilobat.app/guides/curl-could-not-resolve-host.html): curl exit code 6 means that curl could not get an address for the host name.
- [ssh: connect to host port 22: Operation timed out on Mac](https://kilobat.app/guides/ssh-port-22-operation-timed-out.html): ssh sent a connection request to port 22 and got no answer.
- [SSH and Git time out on a Mac](https://kilobat.app/guides/ssh-git-timeouts.html): SSH and Git need a working TCP connection to the server.
- [DNS not resolving on a Mac](https://kilobat.app/guides/dns-server-not-found.html): When DNS fails, the Mac cannot change a name such as apple.com into an IP address.
- [Corporate proxy certificates break Terminal tools on a Mac](https://kilobat.app/guides/corporate-proxy-certificates.html): Some company networks inspect HTTPS traffic.
