Skip to main content
Tech Radar
  • Tech Radar Pro
  • Tech Radar Gaming
Tech Radar Pro TechRadar IT Insights for Business
Subscribe
RSS
(opens in new tab) (opens in new tab) (opens in new tab) (opens in new tab)
Asia
flag of Singapore
Singapore
Europe
flag of Danmark
Danmark
flag of Suomi
Suomi
flag of Norge
Norge
flag of Sverige
Sverige
flag of UK
UK
flag of Italia
Italia
flag of Nederland
Nederland
flag of België (Nederlands)
België (Nederlands)
flag of France
France
flag of Deutschland
Deutschland
flag of España
España
North America
flag of US (English)
US (English)
flag of Canada
Canada
flag of México
México
Australasia
flag of Australia
Australia
flag of New Zealand
New Zealand
Technology Magazines
(opens in new tab)
Technology Magazines (opens in new tab)
Why subscribe?
  • The best tech tutorials and in-depth reviews
  • Try a single issue or save on a subscription
  • Issues delivered straight to your door or device
From$12.99
(opens in new tab)
View Deal (opens in new tab)
  • News
  • Reviews
  • Features
  • Opinions
  • Website builders
  • Web hosting
  • Security
Trending
  • Best standing desk deals
  • Best cloud storage 2023
  • What is Microsoft Teams?
  • Windows 11 for business

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works.

  1. Home
  2. VPN
  3. Computing
Supported (opens in new tab)

How to clear your DNS cache in 5 minutes

By Nate Drake

Turbo-charge web loading times and your privacy with just a few clicks

Man using laptop in office
(Image credit: Unsplash / Anthony Riera)

Each time you type a new web address into your browser’s address bar, your device connects to a DNS Server to translate its simple human-readable name into a machine-readable IP address, so you can connect to your web server of choice.

Many modern devices and operating systems store the IP addresses of the sites you visit in a special DNS cache to help you access them faster in future. 

Problems occur when things start to go stale. Perhaps the website in question has updated its IP address or maybe they’ve added a new server to which you can connect even faster. This can cause web pages to load slowly, or sometimes not all. 

Bad actors like hackers will sometimes target your DNS cache. This is known as ‘DNS poisoning’ and is very dangerous : if, for instance, you typed in the website address of your bank, a hacker could redirect you instead to a copycat ‘phishing’ website. 

DNS settings 

Even if you’re not worried about slow web pages or being targeted by cybercriminals, you may want to update your DNS settings. Public DNS servers such as those offered by Google and Cloudflare are often much faster than those offered by your ISP, and they can filter out harmful links.

If you sign up with one of the best VPN services (and reliable free VPN providers), they will also supply their own DNS servers. This is because if you connect to a VPN but continue to use the DNS servers supplied by your ISP, anyone monitoring your connection can see which websites you’re visiting, as well as what services you’re using, such as Netflix. This is known as DNS leak. 

If you’re considering subscribing to a VPN or updating your DNS settings, you should always “flush” your DNS cache first to clear out any old web data. This is not only better for your privacy. It will stop pages from failing to load properly using the new DNS servers.

Clearing your DNS caches isn’t hard to do but to make sure your settings are updated, you need to do it on each device and browser you use.

How to clear your DNS cache 

There’s very little risk in clearing your DNS cache but as always when making any system-wide change to your system, make sure to save and close any open files, as well as run backups before you start.

Windows

If you’re using Microsoft Windows, clearing the DNS cache is very simple. Simply boot to the desktop, enter “CMD” into the search box to run the Command Line Utility and run:

ipconfig /flushdns

You’ll see a confirmation message to say this has been done.


macOS

If you’re running a Mac, it’s more complicated. In each case you’ll need to boot to your macOS desktop, open Spotlight and search for ‘Terminal’. But the commands you need to enter are slightly different depending on which version of macOS you’re running.

For versions of macOS12 (Sierra) and later run the command:

sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache

For OS X 10.10 (Yosemite) run:

sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder

For OSX Lion, Mountain Lion and Mavericks, run:

sudo killall -HUP mDNSResponder

If you don’t feel comfortable using the Terminal, MacKeeper also has a feature to clear the macOS DNS cache .


Linux

There are many different ‘flavors’ of Linux and it would take too long to provide instructions for how to clear your cache here. However if you’re using a recent version of Ubuntu or one of its variants like Linux, simply open the ‘Terminal’ app and type:

sudo resolvectl flush-caches 

For Red Hat Linux and it’s variants open Terminal and run:

service nscd restart


iOS/iPadOS

If you have an iPhone or iPad, the DNS cache clears itself each time the device restarts or is placed in “flight mode”. Enable flight mode or turn your iOS device off, wait 30 seconds, then reconnect.


Android

Android devices like mobile phones and tablets don’t have a built-in way to clear the DNS cache but you can get round this by installing Chrome on your device, then following the instructions for clearing the cache below.

How to clear browser DNS cache

Just in case you were thinking this was too easy, some browsers also store their own cache to help with faster loading times. These can also become corrupted or be exploited, so make sure to clear them out at the same time you clear the main DNS cache on your computer or mobile device. 

Microsoft Edge

Open Microsoft Edge and click on the three-dot menu at the top right and choose ‘History’. Next choose ‘Clear Browsing Data’. A new window will open. Use the “Time Range” dropdown menu to select “All Time”. Make sure that the tickbox “Cookies and other site data” is checked, then click “Clear Now.”


Safari

With the Safari browser open, click Safari > Preferences. Next, click the ‘Advanced’ tab and check ‘Show Develop Menu’. Click the new ‘Develop’ option in the menu bar, then ‘Empty caches’.

Google Chrome

Open Chrome and type this into the address bar:

chrome://net-internals/#dns

This accesses Chrome settings. Just click the “Clear host cache” button to flush out your old DNS data.


Opera

Like Google Chrome, the Opera browser is based on Chromium, so the steps you need to go through are very similar. Just open the browser and type this into the address bar:

opera://net-internals/#dns

As with Chrome, just click on “Clear host cache” to flush your old DNS settings.


Firefox

Click the Firefox menu icon at the top right of your browser window, then go to “History > Clear Recent History”. Under the “Time range to clear” dropdown menu, choose “Everything,” then click OK. 

DNS clearance 

Clearing out your DNS cache is a great way to improve connection speeds and stay safe from hackers. It also makes it more likely if you’re updating your DNS settings that your devices and installed browsers will work right away.

If you’re still experiencing slow loading times after connecting to a VPN and using their DNS servers, see our guide How to speed up a VPN when you’re not already using one of the fastest VPNs. 

Today's best overall VPNs
Express VPN (opens in new tab)
ExpressVPN 12 month
(opens in new tab)
$6.67
/mth
(opens in new tab)
View Deal (opens in new tab)
UP TO 1 YEAR FREE
NordVPN (opens in new tab)
NordVPN 2 Year
(opens in new tab)
$3.49
/mth
(opens in new tab)
View Deal (opens in new tab)
Exclusive discount
HotSpot Shield (opens in new tab)
Hotspot Shield 3 year
(opens in new tab)
$2.49
/mth
(opens in new tab)
View Deal (opens in new tab)
+2 months free
Surfshark (opens in new tab)
Surfshark 24 Months
(opens in new tab)
$2.30
/mth
(opens in new tab)
View Deal (opens in new tab)
+3 MONTHS FREE
Private Internet Access (opens in new tab)
Private Internet Access 24 Month
(opens in new tab)
$2.11
/mth
(opens in new tab)
View Deal (opens in new tab)
We check over 250 million products every day for the best prices

TechRadar Pro created this content as part of a paid partnership with ExpressVPN.

Are you a pro? Subscribe to our newsletter

Sign up to the TechRadar Pro newsletter to get all the top news, opinion, features and guidance your business needs to succeed!

By submitting your information you agree to the Terms & Conditions (opens in new tab) and Privacy Policy (opens in new tab) and are aged 16 or over.
Nate Drake
Social Links Navigation

Nate Drake is a tech journalist specializing in cybersecurity and retro tech. He broke out from his cubicle at Apple 6 years ago and now spends his days sipping Earl Grey tea & writing elegant copy.

  1. Sennheiser surround system pictured on a wooden floor.
    1
    Sennheiser’s new multi-subwoofer surround system made me question my Sonos setup
  2. 2
    Microsoft Teams is finally fixing one of its most jarring issues
  3. 3
    FCC taking a stand against spam texting
  4. 4
    I asked Bing, Bard, and ChatGPT to solve my anger issues, and the results surprised me
  5. 5
    How to clear your Android phone’s cache
  1. WiiM Pro streamer on white integrated amplifier
    1
    WiiM Pro Music Streamer review: multi-room high-res audio on the cheap
  2. 2
    Hulu and Disney Plus will make streaming movie history in June – and it's about time
  3. 3
    Sennheiser’s new multi-subwoofer surround system made me question my Sonos setup
  4. 4
    Microsoft Teams corrige enfin l'un de ses défauts les plus gênants
  5. 5
    MPB is the best place for vloggers and content creators. Here’s why
Technology Magazines
(opens in new tab)
  • ●
Technology Magazines (opens in new tab)
  • The best tech tutorials and in-depth reviews
From$12.99
(opens in new tab)
View Deal (opens in new tab)

TechRadar is part of Future US Inc, an international media group and leading digital publisher. Visit our corporate site (opens in new tab).

  • About Us (opens in new tab)
  • Contact Us (opens in new tab)
  • Terms and conditions (opens in new tab)
  • Privacy policy (opens in new tab)
  • Cookies policy (opens in new tab)
  • Advertise with us (opens in new tab)
  • Web notifications (opens in new tab)
  • Accessibility Statement
  • Careers (opens in new tab)

© Future US, Inc. Full 7th Floor, 130 West 42nd Street, New York, NY 10036.