我刚刚设置了新服务器,并尝试将 git repo 克隆到其中。无论我尝试通过 http 还是 ssh 进行克隆,我都会收到此错误消息(为保护隐私,客户端名称已隐藏):
fatal: unable to access 'https://gitlab.com/jillii/XXXXX.git/': Could not resolve host: gitlab.com
之前我曾成功将另一个 repo 克隆到服务器上 - 但几个小时后第二个 repo 又出现了这个错误。
似乎服务器没有连接到互联网?当我运行时,ping google.com
它返回:
ping: google.com: Temporary failure in name resolution
我的招数已经用完了。如果你有任何想法或任何可以尝试的东西,请告诉我。
版本:
Ubuntu 22.04.4
编辑:
输出resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (ens192)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 147.75.16.12
DNS Servers: 147.75.16.11 147.75.16.12
DNS Domain: None
当我运行时,ping 147.75.16.12
它停滞在
PING 147.75.16.12 (147.75.16.12) 56(84) bytes of data.
^C
--- 147.75.16.12 ping statistics ---
201 packets transmitted, 0 received, 100% packet loss, time 204799ms
这是输出ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:01:1f:5f brd ff:ff:ff:ff:ff:ff
altname enp11s0
inet 100.69.74.12/24 brd 100.69.74.255 scope global ens192
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:fe01:1f5f/64 scope link
valid_lft forever preferred_lft forever