ping github.com 显示 127.0.0.1

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.

我现在想多台上位机通过交换机与树莓派相连,我上位机与树莓派的系统都是ubuntu22.04ros2humble,现在已经有一台上位机与树莓派相连,# 默认配置 127.0.0.1 localhost 127.0.1.1 xyg-T6AD # IPv6 配置 ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters # 自定义设备映射(保留) 192.168.13.100 pc 192.168.13.161 raspberrypi # Steam++ 配置(精简版,仅保留核心域名) 127.0.0.1 steamcdn-a.akamaihd.net 127.0.0.1 steamuserimages-a.akamaihd.net 127.0.0.1 cdn.akamai.steamstatic.com # GitHub 及 ROS 必需域名(新增,解决网络问题) # 获取最新 IP 方法:https://www.ipaddress.com/ 140.82.114.4 github.com 199.232.68.133 raw.githubusercontent.com 185.199.111.133 githubusercontent.com 140.82.112.20 api.github.com # 其他非必要域名(注释或删除,避免干扰 ROS 网络) # 127.0.0.1 community.akamai.steamstatic.com # 127.0.0.1 avatars.akamai.steamstatic.com # 127.0.0.1 store.akamai.steamstatic.com # ...(保留 Steam++ 核心配置,删除其余冗余映射) # 屏蔽rosdistro外网访问(强制离线模式) 127.0.0.1 raw.githubusercontent.com 127.0.0.1 github.com这是这台已经连好的上位机显示的,127.0.0.1 localhost 127.0.1.1 njj-desktop # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 192.168.13.100 pc 192.168.13.161 raspberrypi # Steam++ Start 127.0.0.1 huggingface.co 127.0.0.1 github.dev 127.0.0.1 api.github.com 127.0.0.1 gist.github.com 127.0.0.1 github.githubassets.com 127.0.0.1 support-assets.githubassets.com 127.0.0.1 education.github.com 127.0.0.1 resources.github.com 127.0.0.1 uploads.github.com 127.0.0.1 archiveprogram.github.com 127.0.0.1 raw.github.com 127.0.0.1 githubusercontent.com 127.0.0.1 raw.githubusercontent.com 127.0.0.1 camo.githubusercontent.com 127.0.0.1 cloud.githubusercontent.com 127.0.0.1 avatars.githubusercontent.com 127.0.0.1 avatars0.githubusercontent.com 127.0.0.1 avatars1.githubusercontent.com 127.0.0.1 avatars2.githubusercontent.com 127.0.0.1 avatars3.githubusercontent.com 127.0.0.1 user-images.githubusercontent.com 127.0.0.1 objects.githubusercontent.com 127.0.0.1 private-user-images.githubusercontent.com 127.0.0.1 github.com 127.0.0.1 pages.github.com 127.0.0.1 githubapp.com 127.0.0.1 hub.docker.com 127.0.0.1 greasyfork.org 127.0.0.1 update.greasyfork.org 127.0.0.1 github.io 127.0.0.1 www.github.io # Steam++ End这是树莓派显示的,请帮我给出我新上位机通过交换机另一个端口与树莓派相连的具体流程越详细越好
06-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值