hostname -f returns "localhost" instead of fqdn
I have a CentOS 6.4 machine I'm setting up for a piece of software I'm evaluating. Part of the install script invokes "hostname -f" and expects an fqnd returned and fails if it doesn't.
I have the following set up:
/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.17.3.242 testbox.<myfqdn.com>
and /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=testbox
GATEWAY=172.17.3.254
nsswitch.conf is set to search files first, then dns and /etc/host is set for the same.
If I execute hostname -f, I get an error "Host name lookup failure". If I append the first line of /etc/hosts with testbox, I get "localhost" returned when I run the same command.
Any idea what I may be missing?
|