How I do it ( and always done it):

hostnamectl set-hostname foobar.localdomain

echo 127.0.0.1 foobar.localdomain foobar >> /etc/hosts
echo ::1 foobar.localdomain foobar >> /etc/hosts

--
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro

----- Original Message -----
> From: "Nicolas Kovacs" <i...@microlinux.fr>
> To: "CentOS mailing list" <centos@centos.org>
> Sent: Wednesday, 10 April, 2019 08:21:11
> Subject: [CentOS] Short or long hostname ?

> Hi,
> 
> For the last ten years or so, I've defined the short hostname in
> /etc/hostname and the FQDN in /etc/hosts. Now I wanted to double-check
> this information, which eventually led me to this page:
> 
>  *
> https://serverfault.com/questions/331936/setting-the-hostname-fqdn-or-short-name
> 
> Now I admit I'm even more confused than before.
> 
> Is there some reliable piece of information on this subject for CentOS ?
> 
> Cheers,
> 
> Niki
> --
> Microlinux - Solutions informatiques durables
> 7, place de l'église - 30730 Montpezat
> Site : https://www.microlinux.fr
> Mail : i...@microlinux.fr
> Tél. : 04 66 63 10 32
> Mob. : 06 51 80 12 12
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
_______________________________________________
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos

Reply via email to