Bug 9842 - hostname -s returns localhost
Summary: hostname -s returns localhost
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: net-tools
Version: 6.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Crutcher Dunnavant
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-02-28 22:46 UTC by rkz
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-02-28 23:01:53 UTC
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.