ping github.com 显示 127.0.0.1
catpinggithub.comsudonameserver8.8.4.4pinggithub.comsudodns=defaultfalsesudodns8.8.8.88.8.4.4sudo。
1. First, let's check your current DNS settings:
cat /etc/resolv.conf
2.Try to ping GitHub:
ping github.com
If this doesn't resolve to a proper IP address, we need to fix your DNS.
3.Try using Google's public DNS servers temporarily:
sudo nano /etc/resolv.conf
Add these lines at the top:
nameserver 8.8.8.8
nameserver 8.8.4.4
4.Save the file and try to ping GitHub again:
ping github.com
5.If this works, you may want to make the DNS change permanent. On Ubuntu, you can do this by editing the NetworkManager configuration:
sudo nano /etc/NetworkManager/NetworkManager.conf
Add these lines under the [main] section:
dns=default
systemd-resolved=false
6.Then, edit your connection settings:
sudo nano /etc/NetworkManager/system-connections/your_connection_name
Under the [ipv4] section, add:
dns=8.8.8.8,8.8.4.4
7.Restart NetworkManager:
sudo systemctl restart NetworkManager
8.If you're still having issues, you might want to check if systemd-resolved is interfering:
sudo systemctl status systemd-resolved
If it's active, you may need to disable it:
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved
After making these changes, try your SSH connection to GitHub again. If you're still having issues, let me know and we can investigate further.
更多推荐
所有评论(0)