0X000025B4

DNS_ERROR_INVALID_DATAFILE_NAME (0X000025B4) fix

This error pops up when Windows DNS Server can't find or load the zone data file. Usually happens after a rename or move of the .dns file in the system32\dns folder.

You're managing a Windows DNS server—could be 2012 R2, 2016, or 2019—and you see this error in the DNS Manager or in the Event Log under DNS Events. The exact text reads: DNS_ERROR_INVALID_DATAFILE_NAME (0X000025B4). The zone won't load. You might've recently renamed a zone, moved a zone file, or restored a backup of the DNS folder. The common trigger: you manually changed the file name in C:\Windows\System32\dns but forgot to update the zone configuration in the registry or DNS console.

Root cause

The DNS server keeps a list of zones in the registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones. For each zone, there's a string value called DataFile that points to the exact .dns file name in the system32\dns folder. If that file doesn't exist, or if the name doesn't match what's in the registry, the server throws 0x000025B4. The server can't find the data file, so it refuses to load the zone.

Short version: the zone expects a specific .dns file, but that file is missing or has a different name.

What you need

  • Admin access to the DNS server
  • Permissions to read the registry (you need this to check the expected file name)
  • Access to C:\Windows\System32\dns

Step-by-step fix

Step 1: Identify the zone and the expected file name

  1. Open DNS Manager (run dnsmgmt.msc). Look at the zone that's showing the error. Write down the zone name (example: example.local).
  2. Open Registry Editor (run regedit).
  3. Go to:
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones
  4. Find the subkey with the same name as your zone. Under that key, look for a value called DataFile. Double-click it and note the file name (example: example.local.dns).
  5. Close Registry Editor.

After this step, you know exactly which file the server expects.

Step 2: Check the actual file in the dns folder

  1. Open File Explorer and go to:
    C:\Windows\System32\dns
  2. Look for a file matching the name from Step 1. If you see it, skip to Step 4. If you don't see it, or you see a file with a different name (like example.local.old.dns), move to Step 3.
  3. If the folder is empty or the file is missing entirely, you need to restore it from backup or recreate it. I'll cover that below.

Step 3: Fix the mismatch

Here's the real fix. You have two paths—choose the one that fits your situation.

Option A: Rename the existing .dns file to match the registry

  1. In C:\Windows\System32\dns, right-click the actual .dns file (the one that's there but has the wrong name).
  2. Choose Rename and change it to exactly what the registry expects (from Step 1).
  3. Press Enter. Accept the UAC prompt if needed.

Option B: Update the registry to match the existing file name

  1. In C:\Windows\System32\dns, note the exact name of the .dns file that's present (example: example.local.2025.dns).
  2. Open Registry Editor again, go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones\yourzone.
  3. Double-click DataFile, change the value to the name you noted (including the extension .dns), and click OK.
  4. Close Registry Editor.

My opinion: Option A is usually simpler and less risky, because you're not poking at the registry unless you have to. But if the file name is something you want to keep (like a date-stamped backup), go with Option B.

Step 4: Restart the DNS service and reload the zone

  1. Open a Command Prompt as administrator or use PowerShell.
  2. Run:
    net stop dns && net start dns
  3. Wait a few seconds, then open DNS Manager.
  4. Right-click the problematic zone and select Reload.
  5. Check the zone now—it should load without the error.

If it still fails

If the error persists, here's what to check next:

  • File permissions: Right-click the .dns file in C:\Windows\System32\dns, go to Properties > Security. Make sure SYSTEM and NETWORK SERVICE have Read & Execute and Read permissions. If not, add them.
  • Corrupt file: The .dns file might be corrupt (zero bytes or garbage). Open it in Notepad—it should start with something like ; Database file example.local.dns for example.local zone. If it's empty or binary, restore from a known good backup.
  • Zone type mismatch: Check if the zone is a primary zone. Secondary zones don't use local .dns files—they get data from a master server. If the zone is secondary, the DataFile registry entry might be wrong. In that case, delete the zone and recreate it as secondary.
  • Check Event Log: Look in Event Viewer > Applications and Services Logs > DNS Server. There's usually a more detailed error entry that says exactly which file it can't find.

A quick sanity check: make sure you're not accidentally looking in the wrong folder. Some admins copy files to system32\dns but the server expects them in system32\dns\backup or system32\dns\samples. The correct folder is C:\Windows\System32\dns (no subfolder).

If you've done all this and it's still broken, your DNS database might be damaged at a deeper level. Restore the system32\dns folder from a known good backup (ideally from before the rename or move), then restart the service.

Related Errors in Network & Connectivity
Fix Ethernet Unidentified Network No Internet on Windows 0X8000400C Fix CO_E_INIT_TLS_CHANNEL_CONTROL (0X8000400C) – TLS Thread Error Wi-Fi Direct Pairing Fails: Devices See Each Other But Can't Connect 0X0000274C WSAETIMEDOUT 0x0000274C: Quick Fix for Connection Timeouts

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.