Description of problem: hostname -f returns <host> not <host>.<domain> Version-Release number of selected component (if applicable): systemd-libs-249.7-2.fc35.x86_64 How reproducible: Always Steps to Reproduce: 1. configure host line in nsswitch.conf to hosts: resolve [!UNAVAIL=return] files myhostname dns 2. hostnamectl --transient $(hostname -s) 3. systemctl stop systemd-resolved 4. hostname -f Actual results: <host> Expected results: <host>.<domain> Additional info: Step 2 obviously does not include the domain name in the transient hostname. This is, apparently, what happens with dhcp network configuration and I would argue it is correct. Even though hostnamectl permits hostname to be set to a fqdn, linux has a limit of 64 characters, which is compatible with a DNS label limit of 63 characters, but not with a DNS fqdn limit of 253 characters. nss-myhostname it seems, is trying to replace (dynamically) what would have traditionally be done via /etc/hosts, where the standard recommendation was to have the canonical name (fqdn) first with aliases after. I think nss-myhostname should be appending the domain name when it looks up the interface addresses. This should be the first search domain in /etc/resolv.conf if it exists. The hostname specification seems to be weakly standardized in the unix world, yet it needs to be consistent, at least on one installation. For example, readonly-root can use the hostname to specify a statefile held on an nfs server. Currently, with the above configuration, hostname -f returns different results depending on whether systemd-resolved is running or not. The above ordering in nsswitch.conf is consistent with the nss-myhostname(8) man page. The man page does contain a caveat regarding reverse resolution and a work around is to place 'myhostname' after 'dns' but this may not work if the real name server is not available (untested).
FEDORA-2022-3ca356cd2e has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-3ca356cd2e
FEDORA-2022-3ca356cd2e has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-3ca356cd2e` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-3ca356cd2e See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-3ca356cd2e has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.