Page MenuHomeVyOS Platform

The "preserve-fqdn" option stuck the hostname displayed in the Logs
Open, NormalPublicBUG

Description

When the VyOS has configured domain-name + preserve-fqdn option and the hostanme if changed after, the /var/log/messages displays the old hostname and not the changed one.

Apr 14 17:07:12 anyHostname.anydomain.es systemd-hostnamed[20865]: Hostname set to <NewHostName> (static)
Apr 14 17:07:12 anyHostname.anydomain.es systemd[1]: Stopping System Logging Service...

Note in the next log the hostname remains as: anyHostname.anydomain.es instead of NewHostName. This is the minimum configuration to trigger the issue:

> set system syslog global preserve-fqdn 
> set system domain-name 'anydomain.es'
> set system host-name 'anyHostname'

As long as the customer tries to change the hostname while the preserve-fqdn option is configured, it won't update the hostname in the logs, until it is deleted. In addition noticed when a hostname has configuerd a period (.) the hostname in the logs doesn't show completele, as the next example:

vyos@vyos# set system host-name hostname.with.period
[edit]
vyos@vyos# commit;save
[edit]
vyos@vyos# tail -f /var/log/messages
Apr 14 17:39:32 hostname vyos-configd[701]: [system_host-name]
Apr 14 17:39:32 hostname vyos-configd[701]: scripts_called: ['system_host-name']
Apr 14 17:39:32 hostname vyos-configd[701]: Sending reply: SUCCESS with output
Apr 14 17:39:32 hostname systemd[1]: opt-vyatta-config-tmp-new_config_2943.mount: Deactivated successfully.
Apr 14 17:39:32 hostname vyos-configd[701]: [system_host-name]
Apr 14 17:39:32 hostname vyos-configd[701]: scripts_called: ['system_host-name']
Apr 14 17:39:32 hostname vyos-configd[701]: Sending reply: SUCCESS with output
Apr 14 17:39:32 hostname systemd[1]: opt-vyatta-config-tmp-new_config_2943.mount: Deactivated successfully.
Apr 14 17:39:34 hostname commit: Successful change to active configuration by user vyos on /dev/ttyS0
Apr 14 17:39:34 hostname commit[5231]: Successful change to active configuration by user vyos on /dev/ttyS0

Conclusion:

  • If the customer then has syslog configured, these logs will show the same way in the syslog server, causing an hostanme issue.

Workaround

  1. Delete the preserve-fqdn option
  2. Then commit;save
  3. Change the hostname to the new one
  4. Configure preserve-fqdn option again.
  5. Then commit;save

Behavior has been tested for new LTS version 1.5 and 1.4.3 and 1.4.4.

Details

Version
1.5, 1.4
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

@j.vela, are you sure that it is not working for 1.5?

I cannot reproduce it for the 1.5 version

Steps I tried:

set system host-name 'r16'
commit

set system syslog preserve-fqdn 
set system domain-name anydomain.es
set system host-name anyHostnam
commit

set system host-name hostname.with.period
commit

Logs:

Apr 23 11:24:14 r16 vyos-hostsd[790]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Apr 23 11:24:14 r16 vyos-hostsd[790]: Sent response: {'data': {'message': 'Applied 8 changes'}}
Apr 23 11:24:14 r16 dbus-daemon[962]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.17' (uid=0 pid=3999 comm="hostnamectl --static")
Apr 23 11:24:14 r16 systemd[1]: Starting Hostname Service...
Apr 23 11:24:14 r16 dbus-daemon[962]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 23 11:24:14 r16 systemd[1]: Started Hostname Service.

Apr 23 11:24:14 anyHostname systemd-hostnamed[4000]: Hostname set to <anyHostname> (static)
Apr 23 11:24:14 anyHostname systemd[1]: Stopping System Logging Service...
Apr 23 11:24:14 anyHostname rsyslogd[2090]: [origin software="rsyslogd" swVersion="8.2302.0" x-pid="2090" x-info="https://www.rsyslog.com"] exiting on signal 15.
Apr 23 11:24:14 anyHostname systemd[1]: rsyslog.service: Deactivated successfully.
Apr 23 11:24:14 anyHostname systemd[1]: Stopped System Logging Service.
Apr 23 11:24:14 anyHostname systemd[1]: Starting System Logging Service...
...
Apr 23 11:25:09 anyHostname vyos-hostsd[790]: Saving state to /run/vyos-hostsd/vyos-hostsd.state
Apr 23 11:25:09 anyHostname vyos-hostsd[790]: Sent response: {'data': {'message': 'Applied 8 changes'}}
Apr 23 11:25:09 anyHostname dbus-daemon[962]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.22' (uid=0 pid=4106 comm="hostnamectl --static")
Apr 23 11:25:09 anyHostname systemd[1]: Starting Hostname Service...
Apr 23 11:25:09 anyHostname dbus-daemon[962]: [system] Successfully activated service 'org.freedesktop.hostname1'
Apr 23 11:25:09 anyHostname systemd[1]: Started Hostname Service.
Apr 23 11:25:09 hostname.with.period systemd-hostnamed[4107]: Hostname set to <hostname.with.period> (static)
Apr 23 11:25:09 hostname.with.period systemd[1]: Stopping System Logging Service...
Apr 23 11:25:10 hostname.with.period rsyslogd[4028]: [origin software="rsyslogd" swVersion="8.2302.0" x-pid="4028" x-info="https://www.rsyslog.com"] exiting on signal 15.
Apr 23 11:25:10 hostname.with.period systemd[1]: rsyslog.service: Deactivated successfully.
Apr 23 11:25:10 hostname.with.period systemd[1]: Stopped System Logging Service.
Apr 23 11:25:10 hostname.with.period systemd[1]: Starting System Logging Service...

Version:

vyos@r16# run show ver
Version:          VyOS 1.5.0
Release train:    circinus
Release flavor:   generic

Built by:         VyOS Inc.
Built on:         Mon 30 Mar 2026 18:57 UTC
Build UUID:       ca4fe7cc-97f3-4c13-9882-75fb09302044

@Viacheslav I have double checked and the issue is happening in 1.5

From the logs provided, I see you have changed from "anyHostname" to "hostname.with.period" successfully. Even though you showed the configuration, I don't see "anydomain.es" in the hostname.
I don't see any issues with the hostname with periods only when I commit; once preserve-fqdn is enabled, it displays the complete hostname + the domain. But after this commit, the hostname gets stuck. As you can see in the example below

However, I just tried again, and the hostname gets stuck in the previous one:

Apr 23 12:36:49 new.hostname.xperientia.es systemd-hostnamed[5806]: Hostname set to <new.name2> (static)    ---> (change of hostname)
Apr 23 12:36:49 new.hostname.xperientia.es rsyslogd: [origin software="rsyslogd" swVersion="8.2302.0" x-pid="5809" x-info="https://www.rsyslog.com"] start
Apr 23 12:36:49 new.hostname.xperientia.es systemd[1]: Stopping System Logging Service...
Apr 23 12:36:49 new.hostname.xperientia.es rsyslogd[3942]: [origin software="rsyslogd" swVersion="8.2302.0" x-pid="3942" x-info="https://www.rsyslog.com"] exiting on signal 15.
Apr 23 12:36:49 new.hostname.xperientia.es systemd[1]: rsyslog.service: Deactivated successfully.
Apr 23 12:36:49 new.hostname.xperientia.es systemd[1]: Stopped System Logging Service.
Apr 23 12:36:49 new.hostname.xperientia.es systemd[1]: Starting System Logging Service...
Apr 23 12:36:49 new.hostname.xperientia.es rsyslogd[5809]: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd.  [v8.2302.0]