Identifying issues with and setting up DNS name resolution on ESXi Server
search cancel

Identifying issues with and setting up DNS name resolution on ESXi Server

book

Article ID: 310760

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article guides you through identifying and resolving name resolution issues that impact the normal operation of ESXi, particularly in HA clustered environments. It also provides the steps to configure host file correctly when a DNS server is unavailable or incorrectly configured. The errors listed in the Symptoms section occur as a direct result of these name resolution failures.
  • Unable to configure vSphere High Availability (HA).
  • Configuring vSphere HA fails at approximately 97% completion.
  • Configuring vSphere HA fails between 85 to 91%.
  • Reconfiguring vSphere HA fails.
  • Adding an ESXi host to a cluster fails.
  • Enabling vSphere HA in a cluster fails.
  • The vCenter server generates the following errors when attempting to configure VMware HA:
     
    • An error occurred during configuration of the HA agent on the host
    • HA agent on <ESX> in cluster <cluster> in <Datacenter> has an error
    • Error: Cannot complete the configuration of the HA agent on the host. Other HA configuration error

  • Host fails to remediate or exit Maintenance Mode.
  • You see the following connection errors:
    • Operation timed out
    • Unable to connect to the MKS: Host address lookup for server failed: No such host is known
       
  • In the Tasks view of vCenter Server, you see the error:

    There are errors during the remediation operation
    Failed to find host
     
  • From the vCenter webclient you might see this error:
    vSphere HA host status

  • Update Manager is unable to scan ESXi hosts.
  • ESXi host disconnects from the vCenter Server.
  • An ESXi host enters a "Not Responding" state in the vCenter Server.

    Example of ESXi /var/run/log/vpxa.log output:

    YYYY-MM-DDThh:mm:ss.###Z warning vpxa[####] [Originator@#### sub=IO.Connection] Failed to resolve localhost IP address;  localhost(IPv6), e: 1(Host not found (authoritative))

    Example of vCenter vpxd.log output:

    YYYY-MM-DDThh:mm:ss.###Z warning vpxd[####] [Originator@#### sub=IO.Connection opID=<opID>] Failed to resolve address; <resolver p:0x0000000000000000, '<host_FQDN>:443', next:(null)>, e: 1(Host not found (authoritative)), async: true, duration: 0msec

    Note: A common cause for an ESXi host dropping out of vCenter Server is due to the DNS (both forward and reverse) not functioning or configured correctly.


  • Ping the DNS server (Failure example):
                
    ping 10.1##.#.## (10.1##.##.##): 56 data bytes
    sendto() failed (Host is down)

 

  • Resolve the vCenter name (Failure example):
    nslookup vsphere.local 10.###.###.##
    nslookup: write to '10.1##.###.##': Host is down
    ;; connection timed out; no servers could be reached

Environment

  • VMware ESXi 7.x 
  • VMware ESXi 8.x

Cause

A common cause for an ESXi host dropping out of vCenter Server is due to the DNS (both forward and reverse) failing or lacking correct configuration.

There is an issue with name resolution if any of these tests fail. ESXi hosts must be able to find each other by:

  • IP address
  • Short Name
  • Fully Qualified Domain Name (FQDN)

Resolution

If an issue with name resolution has been identified it must be resolved either on the DNS server or by using hosts files.

  1. Verify that all ESXi hosts can ping each other by short name. All ESXi hosts in the environment must be able to ping each other by using short name only. 
     
  2. Verify that all ESXi hosts can nslookup each other.

    Use nslookup (reverse IP address lookup) to verify that the appropriate name is associated to a particular IP address.

    For example:

    [root@esx-server-1 /]# nslookup 192.168.#.#
    Server: 192.168.#.#
    Address: 192.168.#.##53

    #.#.168.192.in-addr.arpa name = esx-server-2.example.com
     
  3. Verify that all ESXi hosts can reverse nslookup each other.

    Use nslookup (forward IP address lookup) to verify that the appropriate IP address is associated to a particular name.

    For example:

    [root@esx-server-1 /]# nslookup esx-server-2
    Server: 192.168.#.#
    Address: 192.168.#.##53

    Name: esx-server-2.example.com
    Address: 192.168.#.#
     
  4. Verify that the DNS server has both A Record (Address Record) and PTR record (Pointer record) configured for all ESXi hosts.

     5. Verify that the managing vCenter does not have any improper entries in its "/etc/hosts/" file for the targeted ESXi host.

Configuring hosts files on ESXi

The hosts file on the ESX host is located at /etc/hosts.

Open the file for editing using a text editor such as nano or vi editor.

Example hosts file:
 

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost

# Any line beginning with a pound sign is a comment and will not be read.
192.168.#.# esx-server-1.example.com esx-server-1
192.168.#.# esx-server-2.example.com esx-server-2

# The VMware Virtual Center Server must also have an entry here
192.168.#.# virtualcenter.example.com virtualcenter

Additional Information

  • localhost must always be present in the hosts file. Do not modify or remove the entry for localhost.
  • The hosts file must be identical on all ESXi hosts in the cluster.
  • There must be an entry for every ESXi host in the cluster.
  • Every host must have an IP address, Fully Qualified Domain Name (FQDN), and short name.
  • The hosts file is case sensitive. Be sure to use lowercase throughout the environment.