guide · static export
PC

Fix DNS Lookups That Fail or Return Wrong Results

Pages that load on the second try, one site that only works with the VPN off: DNS is the usual suspect. Three commands and one resolver change settle it.

by@guidox updated:10/31/26 time:20 min level:Intermediate tested on:Windows 11 24H2 works on:Windows 10, Windows 11 tools:Terminal
TL;DR

Flush the cache, query a public resolver directly with **nslookup**, then change the adapter's **DNS servers**. A stale entry in the **hosts** file makes every server look broken.

Before you start

Requirements

  • A terminal
  • Admin rights for the flush
  • Five minutes
Step by step

Instructions

01

Reproduce it with a hostname

Test the name, not the browser. nslookup reports which server answered and what it returned, which separates a broken resolver from a broken website in one command.

nslookup example.com
02

Look at the cache before you clear it

A wrong address that answers instantly comes from the cache. Print it once, note the record, then flush. Clearing without looking throws away the evidence.

ipconfig /displaydns
ipconfig /flushdns
tipThe cache also keeps negative answers. A domain that failed once can keep failing for minutes after the server recovers.
03

Ask a public resolver directly

Querying 1.1.1.1 by address bypasses the router and the ISP. If that answer is right and the default one is not, the resolver in your network is the problem, not the connection.

nslookup example.com 1.1.1.1
04

Set the resolver on the adapter

Manual DNS on the adapter beats a change in the router when you want it to apply to one machine only. Two providers keep working when one has an outage.

Settings > Network & internet > Wi-Fi/Ethernet > DNS server assignment > Manual
1.1.1.1, 9.9.9.9
05

Check the hosts file for that domain

The hosts file wins over every DNS server and is a classic leftover from a blocklist or an old test. Open it as administrator and remove any line that names the failing host.

%SystemRoot%\ystem32\rivers\tc\osts
⚠ warningA hosts entry for a work tool keeps pointing at an old server and looks exactly like a DNS outage.
06

Restart the apps that cache names

Browsers, game launchers and some VPN clients keep their own resolver cache. Close and reopen them, then test with a request that shows the status line instead of a rendered page.

curl -I https://example.com
Troubleshooting

Common issues

It only works after a refresh

A short TTL or a flapping resolver. Set a stable pair of DNS servers and test again after ten minutes.

One site fails, everything else works

A hosts entry, a DNS filter on the router, or a resolver that blocks that domain. Check all three in that order.

Nothing resolves at all

No reachable resolver: the adapter has no gateway, a VPN holds a broken tunnel, or a firewall blocks port 53.

It breaks when the VPN connects

Split DNS sends the query to the wrong place. Set the VPN client to use the local resolver, or accept its DNS for everything.

FAQ

Frequently asked

Does a faster resolver speed up browsing?

It removes the pause before the first byte on a new name. The download itself does not change.

Is encrypted DNS better?

It hides the queries from the network. It does not make lookups faster and can break captive portals.

How to undo this

Set **DNS server assignment** back to Automatic on the adapter and restart the browser. Remove any line you added to the hosts file; the cache rebuilds itself.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress