Hi Andrew,

Andrew C Aitchison <[log in to unmask]>
writes:

> On Tue, 15 Mar 2016, Loris Bennett wrote:
>
>> Hi,
>>
>> I'm using ansible to set up two servers and have run into the problem
>> that on one server 'hostname' returns the just the name of the machine,
>> but on the other I get the FQDN:
>>
>> # hostname -s; hostname -d; hostname -f; hostname
>> tadmin01
>> test.cluster
>> tadmin01.test.cluster
>> tadmin01
>>
>> # hostname -s; hostname -d; hostname -f; hostname
>> tadmin02
>> test.cluster
>> tadmin02.test.cluster
>> tadmin02.test.cluster
>
> Does
> 	type hostname
> give the same result on both machines ?

Yes, in both cases I get

# type hostname
hostname is /bin/hostname

>> The following files are identical on both servers
>>
>> /etc/hosts
>> /etc/resolv.conf
>>
>> The files
>>
>> /etc/sysconfig/network
> 		...		...
>> What other files could have an influence on what 'hostname' returns?
>
> "man hostname" suggests a few more files that could be relevant.

OK, I've checked

  /etc/nsswitch.conf
  /etc/hosts
  /etc/host.conf

all those and there are no differences.

  /etc/sysconfig/network

differ only by

  < HOSTNAME=tadmin01
  ---
  > HOSTNAME=tadmin02

So I'm still confused.

Cheers,

Loris

-- 
This signature is currently under construction.