How to Flush DNS Cache on Any Device
How to flush DNS cache: on Windows 11, open an elevated Command Prompt and run ipconfig /flushdns; on current macOS, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; on Linux, use the command for the resolver that is actually running. Android and iPhone do not expose one universal flush command, so refresh the network or restart the device. A flush affects local cached name-to-address answers only.
How to flush DNS cache: start with the device
DNS turns a hostname such as loqmi.com into records that a device can use to connect. Your operating system keeps recent answers so it does not ask a resolver for every visit. Flushing removes those answers and makes the next lookup ask again. It helps after a DNS or network change, but is not a general speed boost. See what DNS does and how it works.
Choose the cache layer that is stale
A DNS answer can be cached in more than one place. Start with the narrowest matching layer:
| What you observe | Likely layer | First action |
|---|---|---|
| Every browser on one computer fails | Operating-system resolver cache | Run your operating system's command. |
| Only one browser fails | Browser DNS or connection cache | Fully quit and reopen that browser; clear its host cache if it provides one. |
| Several devices on the same Wi-Fi fail | Router, local DNS forwarder, or ISP resolver | Test mobile data or another network, then restart or inspect the router DNS service. |
| Other networks also see the old answer | Remote recursive or authoritative DNS | Check the published record and relevant TTL; a local flush cannot erase remote cache entries. |
Flushing is diagnostic, not proof that the domain is wrong. A “no such domain” answer may be cached upstream; RFC 2308 describes this.
Windows 11
Command Prompt method
Microsoft documents /flushdns as clearing and resetting the Windows DNS client resolver cache.
- Open Start, type Command Prompt, right-click it, and choose Run as administrator. Select Yes if Windows asks for permission.
- Enter
ipconfig /flushdnsand press Enter. - Retry the site or application that failed. The usual success message is Successfully flushed the DNS Resolver Cache; no browser restart is required for the operating-system cache itself.
PowerShell's equivalent is Clear-DnsClientCache. ipconfig /displaydns shows the cache snapshot; nslookup example.com tests a lookup and shows the answering server. See Microsoft's ipconfig documentation and its PowerShell reference.
ipconfig /release, ipconfig /renew, Winsock reset, and TCP/IP reset change other networking. Use them only for DHCP or network-stack symptoms.macOS
Current macOS Terminal method
Open Terminal with Command-Space, type Terminal, and press Return, or use Finder > Applications > Utilities > Terminal. Run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Enter your Mac login password when
sudoasks. The characters will not appear while you type. - Wait for the prompt to return. A successful flush normally produces no confirmation text.
- Quit and reopen the affected browser, then test the hostname again.
This is the commonly used sequence for current macOS releases. Very old OS X versions used different utilities. It does not clear Safari history, cookies, or saved passwords.
Linux
Identify the active resolver first
Linux has no single cache shared by every distribution. A minimal installation may have none; a desktop may use systemd-resolved, nscd, or dnsmasq. Run resolvectl status, then check the services below if it is unavailable.
| Active service | Check | Flush |
|---|---|---|
systemd-resolved | systemctl is-active systemd-resolved | sudo resolvectl flush-caches |
nscd | systemctl is-active nscd | sudo nscd -i hosts |
dnsmasq | systemctl is-active dnsmasq | sudo systemctl restart dnsmasq |
resolvectl flush-caches clears caches maintained by systemd-resolved; see the resolvectl manual. If no caching service is active, there may be nothing local to flush; query with dig example.com.
Android and iPhone
Android
Android does not provide a universal user-facing command for flushing the whole system DNS cache. Start with a low-impact refresh: open Settings > Network & internet > Airplane mode on stock Android, turn it on, then off. Samsung and other manufacturers may use different labels.
- Restart the phone if the refresh did not fix the lookup.
- For a browser-only problem, open Chrome and tap More > Delete browsing data > More options. Select only cached files if appropriate, then tap Delete data. This is not a guaranteed system flush.
- To inspect the resolver, open Settings > Network & internet > Private DNS. The choices are Off, Automatic, or a provider hostname; labels vary. Google recommends keeping Private DNS on when available.
iPhone and iPad
iOS has no public DNS-flush command. Toggle Settings > Airplane Mode on and off, or restart. This refreshes network state without deleting saved Wi-Fi networks. If only Safari or one app is affected, close and reopen it first.
As a last resort, use Settings > General > Transfer or Reset iPhone > Reset > Reset Network Settings. Apple warns that this removes saved Wi-Fi networks and passwords and resets cellular, VPN, and APN settings. See Apple's Wi-Fi guidance.
Browser and router caches
Flushing the operating-system cache may not affect a browser's DNS cache or an open connection. If one browser still reaches an old destination, fully quit and reopen it. Chromium browsers may expose chrome://net-internals/#dns with Clear host cache; Edge may use edge://net-internals/#dns. Firefox can expose about:networking#dns; restarting is safer.
| Scope of the failure | Next test | What the result means |
|---|---|---|
| One browser only | Restart it, then try a private window. | This points to browser cache, secure DNS, an extension, or an open connection. |
| All devices on one router | Try mobile data, then restart the router if appropriate. | This points away from one device and toward the router, resolver, ISP, or site. |
| VPN or managed network | Check the VPN or secure-DNS setting first. | It may send DNS queries somewhere other than the OS resolver. |
Restarting a router can clear its forwarding cache, but not an ISP or public resolver. Use the router login guide to inspect settings; never factory-reset it for this.
Verify the result and find the real cause
A flush is successful when the next lookup is made without the old local entry; it does not prove the website is healthy.
- Open Loqmi's IP tool and note the public IP, ISP, and approximate location. A DNS flush should not change them; a change suggests a separate VPN or network event.
- On Windows run
nslookup example.com; on macOS or Linux rundig example.com. Replace the hostname, note the resolver and answer, and repeat after flushing. - Retry the page. If the command-line lookup works but the browser fails, investigate its cache, secure DNS, proxy, or open connections.
- Use Loqmi's speed test only to compare general latency and throughput. It cannot prove that DNS was flushed.
| Symptom | More likely explanation | Best next action |
|---|---|---|
DNS_PROBE_FINISHED_NXDOMAIN | The name is mistyped, missing, or negatively cached. | Check the hostname and another network; use the NXDOMAIN guide. |
SERVFAIL or a timeout | The resolver, path, validation, or upstream service may be failing. | Query it with nslookup or dig; stop repeating a local flush. |
| Only one website fails | The site's record, delegation, browser, or local policy may be wrong. | Test another domain and network, then check the exact record. |
| Every site is slow or disconnected | The issue may be Wi-Fi, DHCP, router, or ISP. | Follow slow Wi-Fi checks and compare devices. |
Key takeaways
- Windows has a direct flush command; macOS and Linux use resolver-specific commands.
- Android and iPhone have no universal user-facing DNS-flush command; refresh the network before resetting settings.
- A browser, router, VPN, or upstream resolver can keep a different cache after your device is flushed.
- Use a lookup command and Loqmi's tools to separate DNS problems from public-IP, Wi-Fi, and speed problems.
Frequently asked questions
Does flushing DNS change my IP address?
No. It removes cached name-to-address answers on the device where you run it. It does not change the public IP assigned by your ISP, the DNS server configured on the router, or records published for a domain. A VPN reconnect or network reset may change an IP, but that is a separate action.
How often should I flush DNS?
Usually only when you are troubleshooting a lookup problem, testing a DNS change, or switching networks and an old answer is clearly being reused. DNS caches expire according to record rules, so scheduled flushing is not routine maintenance and does not make a normal connection faster.
Why does a website still show the old server after a flush?
Your device is only one cache layer. The browser, router, VPN, ISP resolver, or another recursive resolver may still have the older answer, and negative answers can be cached too. Check the authoritative record and compare the result from another network before assuming the local command failed.
Can I flush DNS without administrator access?
Windows support steps use an elevated Command Prompt or PowerShell, and macOS and Linux commands commonly need sudo. On Android and iPhone, toggling Airplane Mode or restarting does not require an administrator account, while a network reset is a broader settings change that may require the device passcode.
Sources
- Microsoft Learn: ipconfig
- Microsoft Learn: Clear-DnsClientCache
- Ubuntu Manpage: resolvectl
- Android Help: Manage advanced network settings on your Android phone
- Apple Support: Reset iPhone settings to their defaults
- Cloudflare DNS docs: General DNS issues
- RFC 2308: Negative Caching of DNS Queries
- Cisco: Flush or Clear a DNS Cache on Computers and Servers