Clear DNS Cache on vCenter Server
search cancel

Clear DNS Cache on vCenter Server

book

Article ID: 397197

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

After making changes to the DNS server, vCenter may fail to resolve IP addresses or Fully Qualified Domain Names (FQDNs) correctly. The server may still reference outdated DNS information, leading to incorrect IP resolutions, even if a DNS lookup (using nslookup) shows the correct result.

This issue is often seen after changing the IP of an ESXi host's management vmkernel, then updating DNS to reflect the new IP, resulting in the host showing as not responding in vCenter.

Symptoms may include:

  • nslookup to the DNS server returns the correct result.

  • Pinging an FQDN returns an outdated or incorrect IP address.

  • Host IP address conflict detected

Cause

The old DNS information is cached within vCenter for the TTL (time to live) value set in the DNS server, preventing it from reflecting recent DNS changes.

Resolution

To clear the DNS cache and refresh the DNS resolution, follow these steps:

  1. Enable SSH on vCenter
    First, ensure SSH is enabled on your vCenter Server. For instructions, refer to the official VMware documentation:
    Enable or Disable SSH and Bash Shell Access on vCenter Server

  2. SSH into vCenter
    Connect to your vCenter Server using SSH. You can use a terminal or an SSH client like PuTTY.

  3. Clear the DNS Cache
    Run the following commands to restart the DNS-related services: 

    Note: This will briefly interrupt name resolution for other services

    systemctl restart dnsmasq
    systemctl restart systemd-resolved
  4. Verify DNS Resolution
    After restarting the services, verify that vCenter can now resolve the correct IP or FQDN.

Alternatively, you can reboot the vCenter Server Appliance.

Additional Information