hostname -s returns unknown host

Solution Verified - Updated -

Issue

The command hostname -s returns "hostname: Unknown host" even if the hostname is correctly set and retrievable in its long form with 'hostname'

An example:

# hostname

testhost.localdomain.com

# hostname -s
hostname: Unknown host

Environment

Red Hat Enterprise Linux 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content