Why is the netstat output referring to an incorrect local hostname?

Solution Verified - Updated -

Issue

The hostname of the server is "xyz"

$ hostname
xyz
# nslookup xyz
Server:     8.8.8.8
Address:    8.8.8.8#53

Name:   xyz.example.com
Address: 192.168.100.45

However the netstat output shows the local hostname as "abc":

# netstat -a|grep ldap
tcp        0      0 abc:50747     remotehost:ldap     ESTABLISHED 
tcp        0      0 abc:50744     remotehost:ldap     ESTABLISHED 
tcp        0      0 abc:50748     remotehost:ldap     ESTABLISHED 
# netstat -an|grep ldap
tcp        0      0 192.168.100.45:50747     remotehost:ldap     ESTABLISHED 
tcp        0      0 192.168.100.45:50744     remotehost:ldap     ESTABLISHED 
tcp        0      0 192.168.100.45:50748     remotehost:ldap     ESTABLISHED 

Environment

  • Red Hat Enterprise Linux

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