User Agents

Web browsers and everyday web tech, explained

DNS Bad Config Error: Find the Cause and Fix It

· 6 min read · How the Web Works

In this article
  1. Fix a DNS Bad Config in 8 Steps
  2. Where Bad DNS Configs Come From and How to Confirm Each One
  3. Quick Checks Before You Change Anything
  4. Keeping DNS From Breaking Again
  5. When the Error Persists After All This

A DNS bad config error almost always means one thing: the DNS server address your device is using is wrong, missing, or unreachable, so names like google.com can't be turned into IP addresses. The fastest fix is to switch your device to a known-good public DNS such as 8.8.8.8 and 1.1.1.1, then clear the DNS cache.

Time 15 min · Steps 8 · Level Easy

The one symptom that splits the causes: you can reach the internet by IP address but not by name. Open a command prompt or terminal and ping a raw IP such as 8.8.8.8, then ping a name such as google.com. If the IP works and the name fails, your connection is fine and only DNS is broken. If both fail, you have a connection problem (Wi-Fi, router, or ISP outage) and DNS is a symptom, not the cause. Do this test first, because it saves you from reconfiguring DNS on a device whose real problem is a dead cable.

Fix a DNS Bad Config in 8 Steps

  1. Test IP versus name. Ping 8.8.8.8 and then a domain name. IP works but name fails means DNS-only; both fail means a connection fault to fix first.
  2. Switch to a public DNS. On Windows: Settings > Network & internet > your connection > DNS server assignment > Edit, and set manual DNS to 8.8.8.8 (primary) and 1.1.1.1 (secondary). On macOS: System Settings > Network > your connection > Details > DNS. On Android: Settings > Network > Private DNS, or long-press your Wi-Fi network and edit its settings. On iPhone: Settings > Wi-Fi > your network's info icon > Configure DNS. Labels can differ slightly by version.
  3. Flush the local cache. Windows: open Command Prompt and run ipconfig /flushdns. macOS: run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Linux: restart the resolver service or reboot.
  4. Check for typos in manual settings. If DNS was set by hand, a mistyped digit (8.8.8.8 typed as 8.8.8.9) fails silently. Re-enter the addresses rather than trusting what's on screen.
  5. Set DNS back to automatic. If the device was on manual DNS by mistake, choose automatic (DHCP) so the router hands out a working server.
  6. Fix the router's DNS. Log in to the router admin page (often 192.168.1.1 or 192.168.0.1) and check its DNS settings. A wrong value there breaks every device in the house at once.
  7. Restart router and device. Power the router off for 30 seconds, then back on, and reboot the device. This clears stale DHCP leases as well as cached bad settings.
  8. Retest by name. Ping a domain again and load two or three websites in the browser. If names resolve now, the config error is fixed.

Where Bad DNS Configs Come From and How to Confirm Each One

A typo in a manual DNS entry

This is the most common cause by far. Someone (or an app) set a custom DNS server, and one digit is wrong, or the primary server is down and no secondary was entered. Confirm it: open your connection's DNS settings and read the actual numbers. A valid public pair is 8.8.8.8 with 8.8.4.4, or 1.1.1.1 with 1.0.0.1. Anything else that you didn't deliberately choose is suspect. Fix it by correcting the digits or by switching to automatic.

A config file with a syntax error

On Linux, a stray character in /etc/resolv.conf or a bad line in the network manager's config can produce a literal "bad config" style error, often naming the file and line number. Confirm it: open the file named in the error and look at the line it points to. A valid entry looks like nameserver 8.8.8.8 on its own line, no stray commas or spaces. Fix it by correcting the line, then restarting the network service. If the file regenerates on reboot, edit the network manager's settings instead, since resolv.conf may be overwritten.

The router handing out a dead DNS server

Confirm it: if every device in the house fails to resolve names but each device's own settings look correct, the router is the common factor. Log in to the router, find its DNS or internet settings, and either set a public pair there or restore it to get DNS automatically from your provider. One wrong value at the router breaks phones, laptops and TVs together, which is the giveaway.

ISP DNS servers down

Confirm it: your device is set to automatic DNS, the router is set to automatic, and pinging 8.8.8.8 still works, but names fail. That means your provider's DNS servers are unreachable. Fix it by setting a public DNS manually on the device (step 2), which routes around the outage entirely. This is also the case where only some sites fail, because some devices may cache old answers.

IPv6 DNS entries pointing nowhere

Some networks advertise an IPv6 DNS server that doesn't answer, and the device tries it first. Confirm it: in your connection details, look for IPv6 DNS addresses alongside IPv4 ones. If IPv6 DNS is set but IPv6 itself isn't working, either fix the IPv6 setup or disable IPv6 DNS. As a quick test, disabling IPv6 on the device and retesting tells you in under a minute.

Quick Checks Before You Change Anything

Run through these in order, because each takes seconds and rules out a whole branch of causes:

  • Ping 8.8.8.8. Fails? It's a connection problem, not DNS config.
  • Try another device on the same Wi-Fi. Only one device broken? The problem is that device's settings. All devices broken? Look at the router.
  • Try the website on mobile data. Loads fine? Your Wi-Fi network's DNS is the culprit.
  • Check the date and time on the device. A badly wrong clock breaks secure DNS lookups (DNS over HTTPS/TLS) even when the addresses are correct.
  • Restart the browser after flushing the cache, since browsers keep their own DNS cache separate from the operating system's.

Keeping DNS From Breaking Again

Enter two DNS servers, never one. The secondary answers when the primary is down, and a single-server setup is the most common reason a DNS fault takes you fully offline. If you set DNS by hand, write the addresses down somewhere you can find them, so a future typo is easy to spot against the original. Prefer automatic DNS on devices you don't want to maintain, and set your chosen servers once at the router so every device inherits them. If you use DNS over HTTPS in the browser or system, keep its settings consistent with the system DNS; mismatched settings produce intermittent failures that look like a bad config but are really two configs fighting.

When the Error Persists After All This

If names still fail with correct, reachable DNS servers, the fault is deeper: a VPN or security app intercepting DNS (disconnect it and retest), a hosts file overriding domains (Windows: C:\Windows\System32\drivers\etc\hosts; macOS and Linux: /etc/hosts), or a browser extension filtering requests. Reset the browser or test in a private window to separate browser faults from system faults. If the error message names a specific file or line, that message is the diagnosis, read it before changing anything else. On a managed work device, DNS may be enforced by policy, in which case the fix belongs to whoever administers the device.

Official source: Google Android Help