Ask Your Question
0

Why hostname -f does not return FQDN

asked 2011-12-07 04:14:30 -0500

lzap gravatar image

Hello,

I have my FQDN properly set, but hostname -f (or hostname --fqdn) returns only the short version. Why?

[root@otest ~]# grep HOSTNAME /etc/sysconfig/network
HOSTNAME=otest.lan
[root@otest ~]# hostname
otest.lan
[root@otest ~]# hostname -s
otest
[root@otest ~]# hostname -f
otest
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2011-12-07 04:42:28 -0500

lzap gravatar image

Got it, the order in /etc/hosts matters:

X.X.X.X otest.lan otest

vs

X.X.X.X otest otest.lan
edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-12-07 04:14:30 -0500

Seen: 4,201 times

Last updated: Dec 07 '11