Bug 531702

Summary: hostname -s behaviour should be consistent with other UNIXes
Product: [Fedora] Fedora Reporter: Jiri Popelka <jpopelka>
Component: net-toolsAssignee: Jiri Popelka <jpopelka>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: iprikryl, jpopelka, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.60-95.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 319981 Environment:
Last Closed: 2009-11-12 01:00:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Popelka 2009-10-29 08:47:48 UTC
Description of problem:
hostname -s
on a host with a host name that does not resolve in the DNS
behaves differently on Fedora as on FreeBSD/OpenBSD/AIX/MacOsX.

On Fedora when the host name does not resolve in the DNS
hostname -s
returns "hostname: Unknown host" message.
 
On FreeBSD/OpenBSD/AIX/MacOsX when the host name does not resolve in the DNS
hostname -s
returns short host name (no matter if the host name resolves or not).

hostname man page does not say anything about whether the hostname should resolve or not.
-s, --short
  Display the short host name. This is the host name cut at the first dot.


Version-Release number of selected component (if applicable):
net-tools-1.60-93.fc11.x86_64

How reproducible:
Always

Steps to Reproduce:
run hostname -s on a server whose Fully qualified host name does not resolve in the DNS.
 
Actual results:
[root ~]# hostname some.thing.stupid
[root ~]# hostname
some.thing.stupid
[root ~]# hostname -s
hostname: Unknown host

Expected results:
[root ~]# hostname some.thing.stupid
[root ~]# hostname
some.thing.stupid
[root ~]# hostname -s
some

Comment 1 Fedora Update System 2009-10-29 13:09:25 UTC
net-tools-1.60-94.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/net-tools-1.60-94.fc11

Comment 2 Fedora Update System 2009-11-04 12:36:59 UTC
net-tools-1.60-94.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update net-tools'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-11010

Comment 3 Fedora Update System 2009-11-06 00:08:22 UTC
net-tools-1.60-95.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update net-tools'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-11010

Comment 4 Fedora Update System 2009-11-06 09:55:12 UTC
net-tools-1.60-97.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/net-tools-1.60-97.fc12

Comment 5 Fedora Update System 2009-11-11 14:59:09 UTC
net-tools-1.60-98.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update net-tools'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-11140

Comment 6 Fedora Update System 2009-11-12 00:59:52 UTC
net-tools-1.60-95.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.