Try runningĀ
ping github.com
If this also fails then it's likely to be a DNS problem.
Try switching to a public DNS server like Google DNS.
Edit your /etc/resolv.conf:
sudo nano /etc/resolv.conf
Replace its contents with:
nameserver 8.8.8.8
nameserver 1.1.1.1
Try to clone the repo again and see if it works!