Bug 896756

Summary: hostnamectl fails if given an FQDN
Product: [Fedora] Fedora Reporter: Andrew McNabb <amcnabb>
Component: systemdAssignee: systemd-maint
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: barthes.benoit, johannbg, lnykryn, metherid, mkelly, msekleta, notting, plautrba, Simon.Gerhards, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-201-2.fc18.6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-16 02:56:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew McNabb 2013-01-17 22:49:27 UTC
The new hostnamectl command fails if given a fully qualified domain name. For example, the following sequence is incorrect:

$ hostnamectl set-hostname host.example.com
$ hostname
hostexamplecom
$ hostname -s
hostexamplecom
$ hostname -f
hostname: No address associated with hostname
$

The correct output should be:

$ hostnamectl set-hostname host.example.com
$ hostname
host.example.com
$ hostname -s
host
$ hostname -f
host.example.com
$

Comment 1 benoît barthés 2013-01-29 02:45:36 UTC
hello,

# hostnamectl set-hostname example.com --static 
# hostname
example.com

hostname -f
hostname: No address associated with hostname

edit
vi /etc/hosts
127.0.0.1           example.com example 


hostname -f
example.com

after I do not know if this is the expected behavior

Comment 2 Madison Kelly 2013-02-13 18:16:05 UTC
I'm having the same problem as Andrew McNabb. I try to set;

hostnamectl set-hostname an-c03n01.alteeve.ca

and it records in /etc/hostname;

# cat /etc/hostname
an-c03n01alteeveca

As Benoit said, if I add '--static', it records the hostname properly;

# cat /etc/hostname
an-c03n01.alteeve.ca

The systemd version is 'systemd-197-1.fc18.1.x86_64.

Comment 3 Lennart Poettering 2013-04-09 11:22:28 UTC
Fixed in F19.

Comment 4 Jóhann B. Guðmundsson 2013-04-09 17:22:59 UTC
And the fix will be back ported right?

Comment 5 Fedora Update System 2013-04-10 20:09:41 UTC
systemd-201-2.fc18.1 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-201-2.fc18.1

Comment 6 Fedora Update System 2013-04-11 23:22:42 UTC
Package systemd-201-2.fc18.2:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.2'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.2
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-04-15 23:57:26 UTC
Package systemd-201-2.fc18.4:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.4'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.3
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-04-18 02:34:38 UTC
Package systemd-201-2.fc18.5:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.5'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.5
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2013-05-07 13:36:43 UTC
systemd-201-2.fc18.6 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.6

Comment 10 Fedora Update System 2013-05-09 09:59:36 UTC
Package systemd-201-2.fc18.6:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-201-2.fc18.6'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5452/systemd-201-2.fc18.6
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-05-16 02:56:14 UTC
systemd-201-2.fc18.6 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.