DNS Format Error: What It Means and How to Fix It
In this article
A DNS "format error" (FORMERR) means the DNS server you queried received a request it could not parse, so it refused it instead of answering. Most of the time you fix it by switching to a different resolver such as 1.1.1.1 or 8.8.8.8, then clearing the local DNS cache.
Time 10 min · Steps 6 · Level Medium
Pin Down Which Kind of Format Error You Have
- See where the message appears. A browser error page, a command-line tool like nslookup or dig, or a server log each points to a different layer.
- Test another domain. If every domain fails, the problem is your resolver or network; if only one domain fails, that domain's DNS records are broken.
- Query a public resolver directly. Run a lookup against 1.1.1.1 or 8.8.8.8 to bypass your router and ISP resolver.
- Check the response code. FORMERR (format error) is different from SERVFAIL (server failure) and NXDOMAIN (name does not exist) - the code tells you which fix applies.
- Clear the local cache. Flush DNS on your device so a bad response is not reused.
- Retest from another network. Mobile data versus Wi-Fi separates "your network" from "that website".
FORMERR From Your Own Resolver: The Usual Cause
The most common scenario is that your router or ISP's DNS resolver is handing back FORMERR for queries it should answer. You see this as pages failing to load in the browser while the Wi-Fi itself stays connected. Confirm it by opening a terminal or command prompt and running a lookup twice: once with the default resolver, once against a public one. On Windows, nslookup example.com uses the default resolver and nslookup example.com 1.1.1.1 uses Cloudflare's; on macOS or Linux, dig example.com and dig @1.1.1.1 example.com do the same. If the default resolver returns FORMERR and the public one returns an answer, the resolver is the problem.
Fix it by changing your device's DNS servers. On Windows, go to Settings > Network & internet, open your connection's properties, and under DNS server assignment choose Manual and enter 1.1.1.1 and 1.0.0.1 (or 8.8.8.8 and 8.8.4.4). On macOS, System Settings > Network, select your connection, then DNS, and add the addresses. On Android, Settings > Network & internet > Private DNS lets you set a hostname such as one.one.one.one; on iPhone, Settings > Wi-Fi, tap the (i) next to your network and configure DNS. Exact labels can differ slightly by version. Then flush the cache: on Windows run ipconfig /flushdns as administrator; on macOS run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; on recent Linux distributions run resolvectl flush-caches if systemd-resolved is in use. Restarting the router also clears its small DNS cache and is worth doing before deeper changes.
FORMERR for One Site Only: Broken Records on the Far Side
If only a single domain fails, the domain's own DNS records are likely malformed - for example a record with an illegal character, a TXT string longer than 255 bytes that was not split into chunks, or a malformed DNSSEC signature. You cannot fix someone else's zone, but you can confirm it is not your side: query the domain against two public resolvers. If both return FORMERR, the problem sits with the domain, and the practical move is to wait and retry, since the site's operator has to republish the zone. Contacting the site through another channel (a social account or email, if mail still resolves) speeds that up. If the two resolvers disagree, one of them has cached or forwarded a bad response; try a third, such as 9.9.9.9.
If you are the one publishing the zone - you manage the domain's records at a registrar or DNS host - re-read the exact record you last edited. A missing closing quote on a TXT record, a space inside a hostname, or an SPF record built from too many nested includes are all classic triggers. Delete or correct the record, raise the zone's serial number if your provider requires it, and re-test with dig until the response code comes back NOERROR or NXDOMAIN instead of FORMERR.
Reading the Response Code So You Fix the Right Thing
dig prints the status in the header line of its output, for example status: FORMERR. Match the code to the fix: FORMERR means the query itself was unparseable, which points at a broken resolver, a broken forwarding chain, or a malformed record; SERVFAIL means the server tried and failed, which usually points at DNSSEC validation problems or an unreachable authoritative server; NXDOMAIN means the name genuinely does not exist, which is often a typo in the address bar. A quick-checks pass before any changes: confirm another site loads, confirm the address is spelled correctly, try the site in a private browsing window to rule out a browser extension, and try another device on the same network.
Two follow-ups come up often. First, a FORMERR that appears only on one device and not others on the same network points at that device's configured DNS - check its network settings for a manually entered server that is wrong or unreachable, and set it back to automatic. Second, if you run your own forwarding resolver (a small office server or a self-hosted setup), a FORMERR appearing after a software update can mean the forwarder now sends EDNS options the upstream refuses; disabling EDNS on the forwarder, or pointing it at a different upstream, is the standard fix. In either case, test after each single change rather than changing several settings at once, so you know which one worked.
Official source: Internet Engineering Task Force (IETF)