Could not resolve host: gitlab.com

Hi. I just got a new router today, and all of sudden ALL git commands (git clone, git pul, git pushl) to gitlab give the following error:

fatal: unable to access ‘https://gitlab.com/Example/MyRepo.git/’: Could not resolve host: gitlab.com

I can access gitlab.com from my browser, however the following commands on command line ALL fail:

ping gitlab.com
Ping request could not find host gitlab.com. Please check the name and try again.

curl https://www.gitlab.com
curl: (6) could not resolve host

curl https://gitlab.com/cdn-cgi/trace
curl: (6) Could not resolve host: gitlab.com

curl -svo /dev/null https://gitlab.com

  • Could not resolve host: gitlab.com
  • shutting down connection #0

I assume this is a firewall/IP issue on my router or internet service provider. Any ideas?

Check your DNS settings on both your machine as well as your router. If your computer is configured to use the router for DNS, you can manually configure it to use for example google (8.8.8.8 and 8.8.4.4) or OpenDNS (208.67.222.222 and 208.67.220.220) and then see if your computer works. If it does, then it means your router is not resolving DNS. At this point you can then check the configuration on the router. It may be it is by default supposed to get the DNS servers from your ISP, but you can still configure this manually on your router as well to use the ones above, or even better free ones like Quad9.net to protect against malware, phishing, etc.

Thanks for the very prompt reply.

Yes, changing the modem/router’s DNS to use 8.8.8.8 and 8.8.4.4 fixed it.

Thanks!

1 Like