vSphere Diagnostics Tool, as well as other checks can trigger a "hostname -f" vs "hostname" mismatch
search cancel

vSphere Diagnostics Tool, as well as other checks can trigger a "hostname -f" vs "hostname" mismatch

book

Article ID: 432564

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

When running vSphere Diagnostics Tool on a vCenter 9.X, in some scenarios we encounter the following error

        [FAIL]    vCenter PNID Check
                    The PNID (hostname.example.com) does not match the hostname (localhost)!
                    Documentation:     https://knowledge.broadcom.com/external/article?legacyId=2130599 
        [PASS]    vCenter Proxy Check (Not Enabled)
        [PASS]    Root Account Check (Exp: never) 

Other pre-checks, that rely on PNID, might also fail, on account of this mismatch. 

Environment

vSphere 9.x

Cause

Manual entry in the /etc/hosts file, example below, under IPv6 "::1"

# hostname
hostname.example.com

# hostname -f

localhost

# cat /etc/hosts

# Begin /etc/hosts (network card version)

# End /etc/hosts (network card version)
# NET_UTIL_EDIT_BEGIN 2025-06-16T20:54:54.361553
# Generated by NET_UTIL service. Do not modify manually.
127.0.0.1  hostname.example.com hostname localhost
::1  localhost ipv6-localhost ipv6-loopback hostname.example.com hostname
# NET_UTIL_EDIT_END


 

Resolution

Make sure backup is available/ snapshot is always recommended
Amend the entry via vi, remove hostname.example.com hostname from IPV6 line "::1"

from 
# cat /etc/hosts

# Begin /etc/hosts (network card version)

# End /etc/hosts (network card version)
# NET_UTIL_EDIT_BEGIN 2025-06-16T20:54:54.361553
# Generated by NET_UTIL service. Do not modify manually.
127.0.0.1  hostname.example.com hostname localhost
::1  localhost ipv6-localhost ipv6-loopback hostname.example.com hostname
# NET_UTIL_EDIT_END

to 
# cat /etc/hosts

# Begin /etc/hosts (network card version)

# End /etc/hosts (network card version)
# NET_UTIL_EDIT_BEGIN 2025-06-16T20:54:54.361553
# Generated by NET_UTIL service. Do not modify manually.
127.0.0.1  hostname.example.com hostname localhost
::1  localhost ipv6-localhost ipv6-loopback
# NET_UTIL_EDIT_END

Additional Information

Cause is also identified in similar KBs referencing PNID to hostname mapping:
> https://knowledge.broadcom.com/external/article/383882/unable-to-change-pnid.html 
> https://knowledge.broadcom.com/external/article/314047/addressing-vcenter-fqdn-and-hostname-cas.html