How to clear DNS cache, in one table
Each operating system and browser keeps its own DNS cache, so the command depends on where the stale answer sits. On Windows it is ipconfig /flushdns; macOS, Linux, the main browsers and phones each have their own command or page, listed below. Each one empties a single cache on your own device, so you may need two of them: one for the operating system and one for the browser.
| Where | Command or setting | Admin rights |
|---|---|---|
| Windows 10 and 11 | ipconfig /flushdns or Clear-DnsClientCache | ipconfig /flushdns: usually no. Clear-DnsClientCache: yes (run PowerShell as administrator) |
| macOS | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | Yes (sudo) |
| Linux with systemd-resolved | sudo resolvectl flush-caches | Yes |
| Linux with nscd | sudo nscd -i hosts | Yes |
| Linux with dnsmasq | sudo killall -HUP dnsmasq | Yes |
| Chrome, Edge, Brave | chrome://net-internals/#dns (Edge: edge://net-internals/#dns) | No |
| Firefox | about:networking#dns, then Clear DNS Cache | No |
| Android and iPhone | Airplane mode on and off, or restart | No |
When flushing DNS helps, and when it does not
Every DNS answer comes with a TTL (time to live), a number of seconds for which it may be cached. Your browser, your operating system, your Wi-Fi router and your ISP's resolver can each hold a copy until that TTL runs out. Flushing removes the copies held on your own device and nothing else.
Flushing helps when:
- A site's IP address changed and the record has already updated at the resolver you use, but your device still has the old answer.
- You saw an error such as DNS_PROBE_FINISHED_NXDOMAIN while a domain was being set up. "Name does not exist" answers are cached too (negative caching), so the error can stay after the record is fixed.
- You edited your
hostsfile, or switched VPN or DNS provider, and a few names still go to the old place.
Flushing does not help when:
- The ISP resolver (Jio, Airtel, BSNL or any other) still holds the old record. Your flush does not touch its cache, and it will keep serving the old answer until the TTL expires there.
- The record itself is wrong. Flushing only makes you fetch the wrong answer again faster.
- The problem is not DNS at all: the server is down, a firewall blocks you, or the SSL certificate is invalid. Our guide to "This site can't be reached" helps you tell these apart.
Flushing also does not shorten a TTL. If a record was published with a TTL of 86,400 seconds (one day), resolvers that cached it may keep it for up to a day, whatever you do on your laptop. People call this waiting "DNS propagation". It is really caches expiring one by one.
Windows 10 and 11: ipconfig /flushdns
Windows keeps its DNS answers in the DNS Client service's resolver cache. Microsoft's ipconfig reference describes /flushdns as flushing and resetting that cache, including negative ("name not found") entries.
- Press the Windows key, type
cmd, and open Command Prompt. Windows Terminal or PowerShell work too. - Run:
ipconfig /flushdns - You should see "Successfully flushed the DNS Resolver Cache."
On many Windows 10 and 11 machines this works from a normal window. If you get "The requested operation requires elevation" instead, right-click Command Prompt, choose Run as administrator, and run the command again. Work laptops with locked-down policies are the usual case.
In PowerShell, the equivalent cmdlet is:
Clear-DnsClientCache
Microsoft's documentation states that it is equivalent to running ipconfig /flushdns. Unlike ipconfig, it needs elevation: run it from PowerShell opened with Run as administrator, or you get "Access is denied". To see what is cached before or after a flush, use either of these:
ipconfig /displaydns
Get-DnsClientCache
The list includes entries loaded from your hosts file (C:\Windows\System32\drivers\etc\hosts). They come back after a flush, because Windows reloads the file. To stop a hosts entry from working, delete the line from the file.
macOS: dscacheutil and killall -HUP mDNSResponder
On a Mac, DNS caching is handled by the mDNSResponder process. Apple's (now archived) support article on resetting the DNS cache gives sudo killall -HUP mDNSResponder for OS X Yosemite 10.10.4 and later; the same command still works on current macOS. Many admins also clear the directory services cache in the same line:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Open Terminal (Applications, then Utilities), paste the line, and enter your Mac login password when asked. Nothing is printed when it succeeds. The -HUP signal tells mDNSResponder to drop its cache. It does not quit the process, so your network connection stays up.
The sudo discoveryutil mdnsflushcache command that some old posts mention only applied to OS X 10.10 to 10.10.3 and does not exist on current macOS.
Linux: resolvectl flush-caches, nscd and dnsmasq
Linux has no single DNS cache. Which command you need depends on what is running. Many minimal servers have no local cache at all, and each lookup goes straight to the resolver in /etc/resolv.conf.
systemd-resolved (Ubuntu, Fedora, many desktops)
If /etc/resolv.conf points to 127.0.0.53, you are using systemd-resolved. Flush it with:
sudo resolvectl flush-caches
Older tutorials write systemd-resolve --flush-caches. That was the tool's name until systemd 239 (2018) renamed it to resolvectl. systemd keeps the old name for compatibility, but some distributions no longer install it, so use resolvectl. To confirm the flush worked, look at the cache size:
resolvectl statistics
"Current Cache Size" should drop to 0 or close to it. resolvectl query example.com then resolves the name again through the same service.
nscd
Some older or enterprise systems run the name service cache daemon. Its manual gives nscd -i followed by a database name to invalidate that cache:
sudo nscd -i hosts
dnsmasq
dnsmasq is common on routers, Raspberry Pi setups and some desktops. Its manual says it clears its cache when it receives a SIGHUP:
sudo killall -HUP dnsmasq
A SIGHUP also reloads /etc/hosts, but not dnsmasq's main configuration file. Restart the service if you changed that file.
Browsers: Chrome, Edge and Firefox
Browsers keep their own short-lived DNS cache, separate from the operating system's. If you use secure DNS (DNS over HTTPS) inside the browser, the browser does not use the system resolver at all. That is why a site can work in Firefox and fail in Chrome on the same laptop.
Chrome, Edge and Brave
- Type
chrome://net-internals/#dnsin the address bar and press Enter. In Edge useedge://net-internals/#dns, and in Bravebrave://net-internals/#dns. - Click Clear host cache.
- Go to
chrome://net-internals/#socketsand click Flush socket pools. Open connections can keep talking to the old IP address even after the cache is empty. - Reload the site. If it still loads the old version, close and reopen the browser.
The same page works in Chrome on Android, which is the closest thing to a DNS flush button on a phone.
Firefox
Open about:networking#dns and click Clear DNS Cache. The same page lists the names Firefox has cached and the addresses it holds for them.
Phones and routers: Android, iPhone and the Wi-Fi router
Android and iOS have no command to flush DNS. These steps clear the cache in practice:
- Android: turn Airplane mode on, wait a few seconds, and turn it off. A restart does the same. In Chrome on Android you can also use
chrome://net-internals/#dnsas above. - Android Private DNS: under Settings, Network & internet, Private DNS (the path varies by brand), you can set a provider hostname such as
dns.googleorone.one.one.one. Your phone then stops using the mobile network's resolver. This helps when the operator's resolver is the one holding a stale record. Switch back to Automatic when you are done if you prefer the default. - iPhone and iPad: toggle Airplane mode, or restart the device.
- Wi-Fi router: many home routers run a DNS cache for every device on the network. Restarting the router clears it. If every device in the house gets the same old answer and your mobile data gets the new one, the router or the broadband ISP's resolver is holding it.
Check that the new record has reached you
Before and after flushing, compare what your normal resolver says with what public resolvers say. On Windows, macOS and Linux:
nslookup example.com
nslookup example.com 8.8.8.8
nslookup example.com 1.1.1.1
The first line asks your default resolver (usually your router or ISP). The other two ask Google Public DNS and Cloudflare directly. On Linux and macOS, dig gives shorter output and shows the remaining TTL in the second column:
dig example.com A +noall +answer
dig @1.1.1.1 example.com A +noall +answer
How to read the result:
- Public resolvers show the new IP, your default shows the old one: your router or ISP resolver is still caching it. Wait for the TTL, restart the router, or change your DNS settings. Our list of the best DNS servers in India covers the options.
- All resolvers show the new IP, the browser shows the old site: flush the operating system and browser caches as above, then check your
hostsfile. - No resolver shows the new IP: the record has not been changed, or it was changed at the wrong DNS provider. Check which nameservers the domain uses. Flushing on your side will not help.
Google Public DNS (8.8.8.8) and Cloudflare (1.1.1.1) both offer public pages for purging a name from their resolver caches (see the sources below). Google's flush tool asks you to solve a reCAPTCHA and cannot flush domains that use EDNS Client Subnet, and its FAQ notes that cached TTLs are generally limited to six hours. Purging there helps you and everyone else using those resolvers. It has no effect on Jio, Airtel or any other ISP's resolver.
After moving to a new host or VPS
A host move is when DNS caching causes the most confusion. Some visitors reach the new server, others the old one, and the order depends on whose cache expires first. A few habits keep this short:
- Lower the TTL in advance. A day before the move, set the TTL of the A record to 300 seconds (5 minutes). Caches that pick up the record after that will expire it quickly.
- Test the new server before switching. Add a line such as
203.0.113.10 example.com www.example.comto yourhostsfile, using the new server's IP. Only your computer goes to the new server. Remove the line when you are done. - Change the A record (and AAAA, if you use IPv6) at your DNS provider. Our guide to pointing a domain to a VPS shows the records.
- Keep the old server running for at least the length of the old TTL, so visitors with a cached answer still see a working site.
- Flush your own caches and check with
nslookupagainst 8.8.8.8 and 1.1.1.1. - Raise the TTL again once everything points to the new server.
Changing nameservers, rather than a single record, is slower. Delegation is cached under the NS TTL at the registry, which you cannot change, and on many resolvers also under the NS TTL in your old DNS zone. Lower that one too, and keep the old DNS provider serving the zone until both have expired. The full checklist is in our guide to migrating a website to a new host.
DNS and your Bigdomainhost server
Bigdomainhost does not register domains. Your DNS stays with your registrar or DNS provider, and you point an A record at your server's IP. Each KVM VPS in Mumbai or Delhi NCR comes with a dedicated IPv4 address, an IPv6 /64 and reverse DNS you can set yourself. If a site still does not open after a move, message us on WhatsApp at +91 75994 50220 at any time, or call during IST working hours.
This guide was written by the Bigdomainhost team with AI assistance; facts and commands were checked against the linked sources on 23 November 2026.
Sources (checked )
- Microsoft Learn: ipconfig command reference
- Microsoft Learn: Clear-DnsClientCache cmdlet
- Apple Support: Reset the DNS cache in OS X (archived)
- systemd: resolvectl manual
- systemd: NEWS: changes with systemd 239 (systemd-resolve renamed to resolvectl)
- man7.org: nscd(8) manual page
- dnsmasq: dnsmasq manual page
- Google Public DNS: Frequently asked questions: flushing the cache
- Cloudflare: 1.1.1.1 Purge Cache