User Agents

Web browsers and everyday web tech, explained

Error 9017 DNS Bad Key: What It Means and How to Fix It

· 5 min read · How the Web Works

In this article
  1. Clearing Error 9017 in Order of Likelihood
  2. Which Cause You Have: The 2-Minute Check
  3. Stale Cache or Stale Key on Your Machine
  4. Router, ISP, or VPN Breaking the DNS Signature
  5. The Zone Itself Has a Bad or Mismatched Key
  6. What to Do if 9017 Keeps Coming Back

Error 9017, "DNS bad key," is a Windows DNS error that means a DNS security key failed to validate during a signed DNS exchange. It is almost always caused by a stale cached DNS response, an out-of-date TSIG or DNSSEC key on the resolver, or a middlebox (router, VPN, or proxy) mangling DNS packets, and the first fix to try is flushing the DNS cache and retrying.

Time 15 min · Steps 6 · Level Medium

Clearing Error 9017 in Order of Likelihood

  1. Flush the DNS cache. Open Command Prompt as administrator and run ipconfig /flushdns, then retry the failing lookup. A cached signed response with an expired key is the single most common trigger.
  2. Restart the DNS Client service. In Services (services.msc), restart the DNS Client service, or simply reboot, so the client re-negotiates keys from scratch.
  3. Change your resolver temporarily. Set your DNS servers to a public resolver such as Google DNS (8.8.8.8 and 8.8.4.4) or Cloudflare (1.1.1.1 and 1.0.0.1) in your network adapter settings. If the error disappears, your ISP or local resolver holds the bad key.
  4. Disconnect VPN or proxy. VPN clients and web proxies often rewrite DNS packets and break the signatures that carry the key. Disconnect, retry, then reconnect and test again.
  5. Check DNSSEC on the zone. If you administer the DNS server, re-sign the zone and confirm the zone's DS record at the parent still matches, since a mismatched delegation produces exactly this error for outside users.
  6. Update Windows and the network driver. Run Windows Update and check the manufacturer's site for a network adapter driver update, as older DNS client code mishandles some signed responses.

Which Cause You Have: The 2-Minute Check

Run nslookup the-domain-name.com from Command Prompt, then run the same query against a public resolver with nslookup the-domain-name.com 8.8.8.8. If the direct query fails with 9017 but the 8.8.8.8 query succeeds, the problem sits in your resolver chain: your router, your ISP's DNS, or a VPN. If both fail, the problem is on the zone's side, and there is nothing you can fix locally beyond reporting it.

Next, test from another device on the same network. If every device fails, the router or ISP is the culprit; if only one device fails, that machine's DNS cache or client settings are at fault. This pair of tests narrows 9017 down to one of the three causes below in under two minutes.

Stale Cache or Stale Key on Your Machine

Confirm it: the error appears on one device only, and the 8.8.8.8 test succeeds. Signed DNS responses include key material with expiry times, and a cached response whose key has rolled over since it was stored will fail validation with exactly this message.

Fix it in three steps:

  1. Open Command Prompt as administrator.
  2. Run ipconfig /flushdns, then net stop dnscache && net start dnscache (on versions where the service can be stopped; otherwise reboot).
  3. Retry the original lookup. If it still fails, set the adapter's DNS manually to 1.1.1.1 and 1.0.0.1 under Settings > Network & Internet > your adapter > DNS server assignment, then retest. Exact menu labels can differ slightly by Windows version.

Router, ISP, or VPN Breaking the DNS Signature

Confirm it: every device on the network gets 9017, or the error only appears while the VPN is connected. Some routers and ISP resolvers validate DNSSEC themselves and pass on a failure when their own trust anchors are out of date; VPN clients can also strip the EDNS0 options that signed responses depend on.

Fix it in this order:

  1. Disconnect the VPN and retest. If the error clears, enable the VPN's DNS leak protection or set the VPN's DNS to a resolver that handles DNSSEC, then reconnect.
  2. Restart the router. On many models, a reboot forces the router to fetch fresh trust anchors and clear its own DNS cache.
  3. Bypass the router's DNS by setting each device's DNS manually to 8.8.8.8 and 8.8.4.4. If that fixes it, the router's DNS relay is the problem; either keep manual DNS or update the router's firmware.
  4. If only the ISP resolver fails, leave manual DNS in place and report the fault to the ISP, since the trust anchor on their resolver is theirs to fix.

The Zone Itself Has a Bad or Mismatched Key

Confirm it: the 8.8.8.8 query also fails, and a site such as a DNSSEC checker run on the domain reports a validation failure or a DS mismatch. This means the domain's signing key no longer matches the delegation record published at the parent zone, and every validating resolver in the world will refuse the domain.

If you run the domain: re-sign the zone with the current key, then confirm the DS record at your registrar matches the new key's digest before the old signatures expire. Wait for the parent zone's TTL to pass, typically a few hours, then retest from a public resolver.

If you are only a visitor: there is no local fix, and no safe bypass. Do not disable DNSSEC validation system-wide to reach one broken site, because that removes the protection for every other domain you visit. Contact the site's operator and retry later; zone operators usually fix a DS mismatch within hours once it is reported.

What to Do if 9017 Keeps Coming Back

Recurring 9017 on one machine usually points to a network driver or a third-party security tool that intercepts DNS. Update the network adapter driver from the manufacturer's site, and check whether any installed security suite has a "DNS protection" or web-filtering module; disable that module temporarily and retest. If the error follows you across networks and devices, the common factor is your account or the domain itself, not your hardware, so report it to whoever runs the resolver or the zone. Note that error text and menu names can differ slightly between Windows versions, so match on the number 9017 and the words "bad key" rather than the exact wording.

Official source: Microsoft Support