0

I used the following command and tried to clone a repo but unfortunately the following error pops up. I cannot go further

ubuntu@ip-add-rr-ee-ss:~$ git clone https://github.com/repo/file.git

Cloning into 'file'... fatal: unable to access 'https://github.com/repo/file.git/': Could not resolve host: github.com

TheSprinter
  • 1,523
  • 17
  • 30
  • please provide me with the output of `cat /etc/resolve.conf`. Also, did you somehow disable ingress to UDP 53 and TCP 443? – Teodor Todorov Dec 27 '18 at 06:34
  • result of /resolv.conf # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN – tester moving Dec 27 '18 at 06:47

2 Answers2

0

Could not resolve host

This must be due to DNS issue on your EC2 instance (I can see that you're using Ubuntu here)

  1. You can try to use curl to test the connection to that URL first
  2. Check the DNS configuration: cat /etc/resolv.conf
  3. If possible, you should replace your current DNS setting with others DNS like google (8.8.8.8 & 8.8.4.4)
  4. Try to edit that file: vi /etc/resolv.conf
  5. You should insert/edit the following into:
    nameserver 8.8.8.8
    nameserver 8.8.4.4
  6. Save the file by clicking [Esc] and type :wq
Binh Nguyen
  • 1,891
  • 10
  • 17
0

I fixed the problem once I added the following to my outbound connection for my group security setting:

Type: All traffic
Protocol: All
ip: 0.0.0.0/0

This also fixed my sudo yum install issues too.

Vikas Jangra
  • 175
  • 2
  • 9