0

My hostname changed to "cpe-172-101-0-1.maine.res.rr.com systemd-resolved" without my consent on fedora 37. When i type journalctl -u systemd-hostnamed.service

journalctl -xe entry is:

févr. 05 16:27:25 cpe-172-101-0-1.maine.res.rr.com systemd-hostnamed[18393]: Hostname set to <cpe-172-101-0-1.maine.res.rr.com> (transient)
févr. 05 16:27:55 cpe-172-101-0-1.maine.res.rr.com systemd[1]: systemd-hostnamed.service: Deactivated successfully.
févr. 05 16:32:51 cpe-172-101-0-1.maine.res.rr.com systemd[1]: Starting systemd-hostnamed.service - Hostname Service...
févr. 05 16:32:51 laptop-fedora systemd[1]: Started systemd-hostnamed.service - Hostname Service.
févr. 05 16:32:51 laptop-fedora systemd-hostnamed[18679]: Hostname set to <laptop-fedora> (transient)

How can this happen ?

  • I see "cpe-...." in your logs. are you connecting your laptop to a modem or something provide you with an IP address? – Zareh Kasparian Feb 10 '23 at 19:20
  • im connecting to an opnsense firewall which is connected to a 4G/LTE modem all through ethernet –  Feb 11 '23 at 07:54

1 Answers1

1

Fedora simplified the old install process and skips setting a hostname. As you can see, it is showing the transient hostname in both cases. Per the hostnamectl manpage, the transient hostname is a fallback received from the network configuration if there is no static hostname set.

You should manually set a hostname. This can be done by running sudo hostnamectl hostname HOSTNAME (where HOSTNAME is whatever you want it to be). This will update the static hostname and takes priority over transient ones, and will not change.

HPVectra
  • 11
  • 2
  • hi thanks. how can i check the process or get more infos about "the transient hostname is a fallback received from the network configuration" ? –  Feb 11 '23 at 01:19
  • You can check the man page for hostnamectl - https://www.freedesktop.org/software/systemd/man/hostnamectl.html# – HPVectra Feb 12 '23 at 02:58
  • yes, they say "and the transient hostname which is a fallback value received from network configuration (e.g. "node12345678")" –  Feb 13 '23 at 11:47