SCIENTIFIC-LINUX-USERS Archives

March 2016

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Benjamin Lefoul <[log in to unmask]>
Reply To:
Benjamin Lefoul <[log in to unmask]>
Date:
Tue, 15 Mar 2016 10:49:48 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (59 lines)
Hi Loris,

On SL7, I believe hostnames are best set declaratively in the file /etc/hostname (as has been the case for long on other distros).
I suspect the preferred imperative way to set hostname is with "hostnamectl set-hostname" (check the man hostnamectl).

Regards,

Benjamin Lefoul
nWISE AB


________________________________________
From: [log in to unmask] <[log in to unmask]> on behalf of Loris Bennett <[log in to unmask]>
Sent: 15 March 2016 11:43
To: [log in to unmask]
Subject: Setting hostname

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

The following files are identical on both servers

/etc/hosts
/etc/resolv.conf

The files

/etc/sysconfig/network

differs just in the following way:

< HOSTNAME=tadmin01
---
> HOSTNAME=tadmin02

What other files could have an influence on what 'hostname' returns?

Cheers,

Loris

--
This signature is currently under construction.

ATOM RSS1 RSS2