Centos – What would cause the hostname FQDN to repeat the suffix twice

centosdhcpdomain-name-systemfqdnhostname

I have three new CentOS 6 servers that connect to a DHCP server to get an IP and to have DNS/rDNS setup to bind their FQDN and IP.

Two of them are behaving as expected.

One of them is appending the suffix twice.

Instead of fulton.mydomain.com we get fulton.mydomain.com.mydomain.com as the FQDN.

This is not coming from /etc/sysconfig/network:

[root@fulton ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=fulton
[root@fulton ~]# 

On the other two systems /etc/sysconfig/network also just has the single names.

This is acting as if the main name is "fulton.mydomain.com" which then has mydomain.com appended again.

I cannot figure out if machine "fulton" is reporting its name to DHCP as fulton.mydomain.com when it should be just using fulton or if something in the DHCP server is causing this.

I cannot find anywhere on fulton where the fulton.mydomain.com is specified instead of just fulton.

The /etc/hosts file on all machines is completely generic:

[root@fulton etc]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

On the DHCP / DNS server system, the only mention of these systems is in:

/var/lib/named/dyn/mydomain.com.zone
/var/lib/named/dyn/10.0.zone

Thanks,
Laurence Brevard
San Jose, CA

Adding various hostname outputs and sysconfig/network

[root@fulton sysconfig]# hostname -v -f
gethostname()=`fulton.home.rcousins.com'
Resolving `fulton.home.rcousins.com' ...
Result: h_name=`fulton.home.rcousins.com.home.rcousins.com'
Result: h_addr_list=`10.0.5.223'
fulton.home.rcousins.com.home.rcousins.com

See above – OOPS

[root@fulton sysconfig]# hostname
fulton.home.rcousins.com

PRETTY SURE ABOVE SHOULD JUST BE: fulton

[root@fulton sysconfig]# hostname -s
fulton

SHORT NAME ABOVE IS CORRECT

[root@fulton sysconfig]# cat network /etc/sysconfig 
NETWORKING=yes 
HOSTNAME=fulton

AND ABOVE IS CORRECT

Best Answer

NEVERMIND!

Apparently old information from earlier misconfiguration was still cached in the DNS server (named running on OpenSUSE 11.1).

Power-off of fulton
Flush bind cache on DNS server
Power-on of fulton

FIXED

[root@fulton ~]# date
Sat Aug 17 08:05:41 PDT 2013

[root@fulton ~]# hostname -f -v 
gethostname()=`fulton'
Resolving `fulton' ...
Result: h_name=`fulton.home.rcousins.com'
Result: h_addr_list=`10.0.5.223'
fulton.home.rcousins.com

BEFORE, the above was showing the brain damaged fulton.home.rcousins.com.home.rcousins.com

[root@fulton ~]# hostname -s
fulton

ABOVE was always correct

[root@fulton ~]# hostname
fulton

NOW ABOVE shows the short name instead of fulton.home.rcousins.com

In summary the name really is controlled by that in /etc/sysconfig/network.

It was just that someone had put in the long name at some point in setting up the system and that resulted in bad information in the DNS server until flushed.