I have an Ubuntu server called crow:
$ hostname
crow
But when I try to ping it (from itself), I get unknown host:
$ ping crow
ping: unknown host crow
This is despite explicitly adding crow to /etc/hosts:
$ sudo cat /etc/hosts
127.0.0.1 localhost crow
What am I doing wrong?
Additional info in response to comments:
The hosts line of /etc/nsswitch.conf looks like this:
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
Check permissions on /etc/hosts and /etc/nsswitch.conf files. They should be world-readable.