我在使用 ssh 连接服务器时遇到问题。我收到以下错误消息:
ssh user@host
SSH: Could not resolve hostname user@host: Name or service not known with my connection
另外,如果我尝试使用 ping 也会出现错误:
ping: unknown host
但与另一台服务器 ping 操作成功:
ping google.com
PING google.com (203.211.0.99) 56(84) bytes of data.
64 bytes from 203.211.0.99: icmp_seq=1 ttl=59 time=8.68 ms
……
此外,只有当我尝试从家里连接时才会出现这些错误。当我使用来自其他地方的连接时,我没有问题。所以我想它与我的网络相连,但我真的不知道在哪里查看...
以下信息或许对您有帮助:
/etc/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
nameserver 127.0.1.1
search hitronhub.home
/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
/etc/hosts
127.0.0.1 localhost
127.0.1.1 natahem
# 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
答案1
好的,现在一切正常。
看来是连接问题。我重启了所有东西,现在问题解决了!