通过局域网中的主机名无法访问Debian


9

无法通过其局域网中的主机名发现我的debian。

我在局域网中还有其他几个ubuntu机器,它们都可以通过其主机名ping通。

在我的debian上:

pi@raspberrypi ~ $ hostname
raspberrypi

在同一局域网中的另一台计算机上:

ping raspberrypi
ping: unknown host raspberrypi

Answers:


10

您的Ubuntu系统正在运行Avahi守护程序,而Raspberry Pi则不是这样。安装Avahi解决此问题:

# apt-get install avahi-daemon avahi-discover libnss-mdns

jftr您可能必须使用.local域,例如raspberrypi.local
Ulrich Dangel 2013年

Ubuntu何时/如何运行守护程序?我没有看到任何所谓的“的avahi”中的输出ps -x
斯瑞达Sarnobat

编辑-运行service --status-all | grep avahi
Sridhar Sarnobat,2014年

0

按照建议删除/安装了avahi和insserv,重新启动了整个shebang。工作了。

如果可以从网络上的另一台计算机ping IP地址,请添加选项-a进行反向查找。我自己发现路由器上的主机名最大长度为15个字符。

ping -a 192.168.1.123
Pinging RASPBERRYPI [192.168.1.123] with 32 bytes of data:
...

只要不告诉您名字,您就可以耕low。


0

如果您更改了主机名,请尝试在Pi上安装samba。

sudo apt-get install samba

然后从您的远程计算机尝试以下操作:

ping newhostname.local

和ssh:

ssh pi@newhostname.local
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.