[root@data001 etc]# hostname
data001.dd
[root@data001 etc]# ping data001.dd
ping: unknown host data001.dd
[root@data001 etc]#
How do I fix this? This is on a fresh Centos6 build...does this not come configured by default?
[root@data001 etc]# hostname
data001.dd
[root@data001 etc]# ping data001.dd
ping: unknown host data001.dd
[root@data001 etc]#
How do I fix this? This is on a fresh Centos6 build...does this not come configured by default?
edit /etc/sysconfig/network
and change the HOSTNAME
setting to say data001
instead of data001.dd
. Edit /etc/hosts and make sure you have a line 127.0.1.1 data001.dd data001
. If you already have such a line, make sure that data001.dd
is the first thing after the ip address. Doing this with 127.0.0.1
instead of 127.0.1.1
is also common, valid, and acceptable. Don't remove localhost from that line, if it exists.
After you are done, all these should work:
getent hosts data001.dd
getent hosts data001
ping data001.dd
hostname --fqdn
ping localhost
etc...