尽管将主机名添加到 /etc/hosts 中,但仍会在主机名上获取“未知主机”

san*_*ity 2 ubuntu hosts

我有一个名为 crow 的 Ubuntu 服务器:

$ hostname
crow
Run Code Online (Sandbox Code Playgroud)

但是当我尝试 ping 它(从它本身)时,我得到了未知主机:

$ ping crow
ping: unknown host crow
Run Code Online (Sandbox Code Playgroud)

尽管在 /etc/hosts 中明确添加了乌鸦:

$ sudo cat /etc/hosts
127.0.0.1       localhost crow
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

回复评论的附加信息:

/etc/nsswitch.conf 的 hosts 行如下所示:

hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
Run Code Online (Sandbox Code Playgroud)

rvs*_*rvs 5

检查 /etc/hosts 和 /etc/nsswitch.conf 文件的权限。它们应该是世界可读的。