1

I set the hostname.

# more /etc/hostname
kafka01.ocff4.com

The hostname is still as follows.

hostname
kafka01

I restart using the following command.

 systemctl restart systemd-hostnamed

But still, hostname does not show the FQDN.

hostname
kafka01

Why did systemctl restart systemd-hostnamed not take affect? Is it a bug?

0
1

Take a look at your /etc/sysconfig/network file. If your hostname isn't present in the file, place the following line in it: hostname kafka01.ocff4.com

You'll also have to "sudo hostname kafka01.ocff4.com" at the command line to make the change take affect immediatly, or restart to make the change take affect.

4
  • not in /etc/syconfig/network – yael Oct 23 '17 at 13:18
  • 2
    You might have to enter "sudo hostname kafka01.ocff4.com" at the command line, or restart to make the change take affect. – L.Ray Oct 23 '17 at 13:21
  • 1
    With systemd you should be using hostnamectl – Raman Sailopal Oct 23 '17 at 13:36
  • why - systemctl restart systemd-hostnamed not take affect?? is it a bug? – yael Oct 23 '17 at 14:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.