Bug 9842

Summary: hostname -s returns localhost
Product: [Retired] Red Hat Linux Reporter: rkz
Component: net-toolsAssignee: Crutcher Dunnavant <crutcher>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-28 23:01:53 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 rkz 2000-02-28 22:46:11 UTC
While the command 'hostname' returns the correct fully qualified name
'hostname -s' always returns 'localhost' as its answer

Comment 1 Jeff Johnson 2000-02-28 23:01:59 UTC
This isn't a bug. The behavior depends on how your name service is set
up. Check your /etc/hosts.

FWIW, on my sparc64 named krusty.devel.redhat.com, hostname -s returns
krusty. My one-line /etc/hosts looks like
	127.0.0.1       localhost

and my /etc/nsswitch.conf has
	...
	hosts:      files nisplus nis dns