
When you type a website into your address bar—like PCMag.com—your computer doesn’t actually know where to go on its own. Instead, it looks that address up on a Domain Name System (DNS) server, which matches it with an IP address for your computer to visit. It’s like your friend saying “meet me at Tom’s Bistro”—if you don’t know where Tom’s Bistro is, you can look up the address in the phone book and drive there.
However, it can take a long time to scan the phone book before you find the right address. In order to speed this process up, your computer saves some of these entries for easy access later on. To continue with the previous metaphor, it’s like writing down “Tom’s Bistro – 123 Main Street” on a sticky note. This allows your computer to navigate to sites you’ve already visited, without asking the DNS server every time.
Unfortunately, on rare occasions, this cache can cause problems. Maybe the site you’re visiting changed servers and is no longer located at the cached address, or you have some malware that’s trying to redirect common pages to malicious sites. (If you think the problem could be malware, you might want to run a scan with one of these tools.) Whatever the case, you can “flush” your DNS cache to start from scratch, so your computer looks up web addresses on the DNS server again.
This process is different from clearing your web cache from a browser. If clearing your browser’s cache has not solved the problem, clearing your DNS cache may be the next step. It’s also different from changing your DNS server from one destination to another, which can help if there’s an issue with the server itself. Here’s how to flush your DNS server from Windows and macOS, using the command line. (If you’re using Linux, you’ll need to look up instructions for your particular distribution.)
If you’re on a Windows machine—any Windows machine, even going back to XP and older—flushing the DNS requires a simple command. Click the Start menu and type “cmd.” Right-click on the Command Prompt and choose Run as Administrator. Type ipconfig /flushdns In the Command Prompt window that appears. If successful, the Command Prompt will report back with “Successfully flushed the DNS Resolver Cache.”
Try visiting the website in question again, and see if that solved the problem. If not, the site may be down, you could be having Wi-Fi problems, or you may have a more elusive network problem on your end that needs to be tracked down. If this is someone else’s computer, you can always try troubleshooting remotely.
Mac users need to run a quick Terminal command to flush the DNS cache, but the command differs depending on your version of macOS. First, press Command + Space to open Spotlight and search for “Terminal.” Press Enter to open the program. Since macOS Catalina, you can type sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder into the Terminal and press Enter.
If you happen to be using an older version of macOS, you’ll need to use a different command line code, viewable here. If you’re not sure what version of the operating system you’re running, click the Apple icon and choose About This Mac to see the name and version number. You won’t see a success message once the command has been entered, but you can check the problematic website and see if it fixed the problem. If not, you’ll have to try other troubleshooting steps.
Whitson Gordon is a writer, gamer, and tech nerd who has been building PCs for 10 years. He eats potato chips with chopsticks so he doesn’t get grease on his mechanical keyboard.
PCMag is obsessed with culture and tech, offering smart, spirited coverage of the products and innovations that shape our connected lives and the digital trends that keep us talking.

More Stories
Encryption Making Africa Safer: Internet Society Hosts Encryption Advocacy Workshop for African Civil Society
WSIS+20 Reaffirms Multistakeholder Governance and a Lasting IGF
Online Age Restrictions Need Strong Rules and Independent Oversight