Configure DNS Client Cache Using Regedit

Windows automatically caches DNS query results to accelerate web browsing and network connectivity. By modifying specific values in the Windows Registry via Regedit, you can customize how the DNS client handles this cached data. This includes altering the Time-to-Live (TTL) settings for both successful (positive) and unsuccessful (negative) DNS responses, enabling you to optimize network performance, force quicker DNS record updates, or troubleshoot name resolution issues.


Step 1: Open the Registry Editor

  1. Press Win + R on your keyboard to open the Run dialog box.
  2. Type regedit and press Enter (or click OK).
  3. If prompted by User Account Control (UAC), click Yes to grant administrative privileges.

Step 2: Navigate to the DNS Client Parameters Key

In the Registry Editor address bar at the top, paste the following path and press Enter:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters

Alternatively, manually expand the folders in the left sidebar to reach the Parameters key.


Step 3: Configure Cache Values

You can add or modify two primary DWORD (32-bit) values within this key to control DNS caching behavior:

1. MaxCacheTtl (Maximum Positive Cache Time)

Controls the maximum duration (in seconds) that successful DNS responses remain stored in the local cache.

2. MaxNegativeCacheTtl (Maximum Negative Cache Time)

Controls the maximum duration (in seconds) that failed DNS responses (e.g., domain not found) are stored in the local cache.


Step 4: Apply the Changes

Registry changes to the DNS Client service do not take effect immediately. To apply the new configuration:

  1. Open Command Prompt as Administrator (press Win + S, type cmd, right-click and choose Run as administrator).

  2. Flush the existing DNS cache by running:

    ipconfig /flushdns
  3. Restart your computer, or restart the DNS Client service by running:

    net stop dnscache && net start dnscache

    (Note: On newer Windows versions, stopping dnscache via the command line may be restricted; restarting the computer is the most reliable way to apply changes).