Your Search Bar For Shrewd Tips

How Do I Clear Vcenter Dns Cache?


When vCenter Server resolves a hostname to an old or incorrect IP address, clearing the DNS cache may help—but the cache might be on the vCenter appliance, a Windows DNS server, an administrator’s computer, or inside a running vCenter service. The right fix depends on which system is returning the outdated result. This guide explains how to check name resolution and safely clear DNS caches for vCenter Server Appliance (VCSA) and Windows-based vCenter environments.

What Does Clearing the vCenter DNS Cache Do?

DNS translates a hostname, such as vcenter.example.com, into an IP address. Operating systems and applications can temporarily retain DNS answers so they do not have to query a DNS server every time. If a DNS record changes, a cached answer may continue pointing to the previous address until its time to live (TTL) expires or the cache is cleared.

There is not necessarily one universal “vCenter DNS cache.” The result can be cached at different points along the lookup path:

  • The computer you are using: Your workstation may have cached the old address even when vCenter and DNS are correct.
  • The vCenter Server Appliance: The appliance’s operating system or an installed resolver service may cache DNS answers.
  • A Windows DNS server or another DNS resolver: The server that answers DNS queries may still have an older record in its cache.
  • A vCenter service: A running process may retain a resolved address independently of the operating system’s DNS cache.

Clearing the wrong cache will not fix the issue. First compare the answer returned by the affected system with the answer returned by your authoritative DNS server.

Before You Clear a DNS Cache

Record the hostname and the IP address you expect it to resolve to. Then check the record from more than one location. On a Linux-based system, use getent hosts vcenter.example.com or nslookup vcenter.example.com. On Windows, use nslookup vcenter.example.com or Resolve-DnsName vcenter.example.com. Replace the example hostname with your actual fully qualified domain name.

If the answer is wrong everywhere, check the DNS record and the DNS server configuration before flushing caches. If only one machine returns the old address, clear or investigate the cache on that machine first. Also check that the appliance is configured to use the intended DNS servers and that forward and reverse records are correct. Avoid changing vCenter’s hostname or IP address as a troubleshooting shortcut; those changes can affect certificates, services, integrations, and the vCenter database.

Clear the DNS Cache on a VCSA

VCSA runs on a Linux-based operating system, but the DNS resolver and caching components can vary by appliance version and configuration. Do not assume that a particular cache service is installed. Use the vCenter Server Appliance Management Interface (VAMI) or a supported SSH session to inspect the appliance, and use only commands that match the services present on your system.

  1. Connect to the appliance. Open an SSH session using an account authorized for appliance administration. If SSH access is disabled, enable it through the VAMI for the time needed to troubleshoot, following your organization’s access policy.
  2. Check the configured resolver. Review /etc/resolv.conf and confirm that the listed nameservers are the intended DNS servers. Do not edit appliance-managed configuration files unless the relevant VMware guidance for your version calls for it.
  3. Test the lookup from the appliance. Run getent hosts vcenter.example.com or nslookup vcenter.example.com. If available, query a specific DNS server directly with nslookup vcenter.example.com <DNS-server-IP>. This helps distinguish an appliance cache issue from an incorrect answer supplied by the DNS server.
  4. Check for a local caching resolver. Use systemctl is-active systemd-resolved to see whether that service is active. You can also check whether nscd is installed and running. The commands and available utilities differ between appliance releases, so an unavailable command does not by itself indicate a fault.

If systemd-resolved is active and the resolvectl utility is available, flush its cache with:

resolvectl flush-caches

Then repeat the lookup test. If your appliance uses a different, verified caching resolver, follow the documented procedure for that service and appliance version. Do not stop or restart an unfamiliar service just because its name appears related to networking. A service restart can briefly affect name resolution or other appliance functions.

If no operating-system DNS cache is active, the stale answer may be coming from the DNS server or from a running application. In that case, flushing an OS cache will not force every vCenter process to discard its own lookup result. Confirm the correct DNS response first. If a specific vCenter service still uses an old address, consider a targeted service restart only when appropriate for your version and maintenance plan. Restarting services can interrupt vCenter operations and should not be treated as a routine cache-clearing step.

Clear the DNS Cache on a Windows-Based vCenter Server

Some older vCenter Server deployments run on Windows. To clear the local Windows DNS client cache, open Command Prompt as an administrator and run:

ipconfig /flushdns

Windows should report that the DNS Resolver Cache was successfully flushed. You can then test the hostname again with nslookup vcenter.example.com. This command clears the local client cache on that Windows computer; it does not clear a separate DNS server’s cache, another computer’s cache, or a cache held inside a running application.

If the Windows server itself is running the DNS Server role and its cache contains the stale result, an administrator can clear that server cache in PowerShell:

Clear-DnsServerCache -Force

This command applies to the Windows DNS Server service and requires suitable permissions and the DNS Server tools. Use it only when you have confirmed that the DNS server is the source of the stale answer. If your organization uses an external DNS service, a firewall appliance, or another resolver, follow that provider’s procedure instead.

Clear the DNS Cache on Your Workstation

If vCenter’s IP address appears incorrect only in a browser or on your administrator’s computer, flush the workstation cache before changing anything on the appliance. On Windows, run ipconfig /flushdns in an elevated Command Prompt. On macOS, DNS cache-flushing commands vary by operating-system release; use the procedure for your specific version and restart the browser if needed. On Linux, the appropriate command depends on the active resolver, such as NetworkManager, systemd-resolved, or another service.

Also try querying DNS directly with nslookup or dig, rather than relying on a browser error. Browsers may use their own DNS-over-HTTPS settings or retain connections and name information. Testing from a second computer or network can help establish whether the issue is limited to one client.

When the DNS Server Has the Old Record

If a direct query to your DNS server returns the old IP address, clearing the vCenter cache is unlikely to help. Verify the record on the authoritative DNS server. Check for duplicate A or AAAA records, an outdated CNAME, an incorrect search suffix, or a record that was updated on one DNS server but has not replicated to others. If you recently changed the record, its TTL and your DNS replication schedule may affect how quickly clients receive the new answer.

For a Windows DNS server, an administrator can inspect the record in DNS Manager or use the DNS Server PowerShell tools. For other DNS platforms, use the provider’s management interface or command-line tools. Correct the record at its source, then query the server again. Avoid repeatedly flushing client caches while the authoritative answer is still wrong; clients will simply cache the incorrect response again.

When a vCenter Service Still Uses the Old IP

A successful DNS lookup from the appliance does not prove that every running service has refreshed its own lookup. Some applications retain resolved addresses for a period of time, separately from the operating-system cache. If a particular vCenter function continues connecting to an old address after DNS is correct, identify which service or integration is making the connection before taking action.

Review relevant logs and service health, and check whether the affected service is using a hostname or a hard-coded IP address. If a service restart is necessary, use the supported service-management method for your vCenter version and restart only the affected component when possible. Plan for a potential interruption, notify users, and follow your change-management process. Restarting all vCenter services or rebooting the appliance just to flush DNS is a broad measure that may cause avoidable downtime.

Common Mistakes to Avoid

  • Flushing the wrong system: Clearing a workstation’s cache cannot remove a stale answer held by a DNS server or vCenter service.
  • Assuming every VCSA has the same resolver: Check which caching service is actually present and active before using a resolver-specific command.
  • Changing the appliance hostname or IP unnecessarily: These settings can have wide-ranging consequences and are not a substitute for correcting DNS records.
  • Restarting every vCenter service: Broad restarts can disrupt management operations and may not address the source of the stale answer.
  • Ignoring DNS configuration and TTLs: If the DNS server still returns the previous address, a local cache flush will not provide a lasting fix.
  • Forgetting reverse DNS: Some environments and integrations also rely on PTR records. Check forward and reverse lookups when troubleshooting identity or connectivity problems.

How to Confirm the Fix

After clearing the relevant cache or correcting the DNS record, query the hostname again from the affected system. Confirm that the answer matches the expected IP address, and test the vCenter URL or the specific integration that was failing. If available, query more than one configured DNS server to verify that they return consistent results.

If the lookup is correct but the application still fails, DNS may no longer be the problem. Check network routing, firewall rules, certificates, service status, and the application’s configured endpoint. Keep a note of the original result, the change made, and the successful verification so future troubleshooting can distinguish a DNS issue from a connectivity or service issue.

Conclusion

To clear the vCenter DNS cache, first find out where the stale answer is being cached. Use resolvectl flush-caches only when that resolver is active on VCSA, use ipconfig /flushdns for a Windows DNS client, and clear a Windows DNS Server cache only when that server is confirmed to be the source. If the DNS server returns an outdated record, correct the record there. If the operating-system lookup is current but a vCenter service still uses an old address, investigate that service and use a targeted, planned restart only when necessary.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →