How to force refresh to clear Windows10/MAC/Linux/CentOS DNS cache?

AsWordPress websiteAdmins, we sometimes encounter situations where some styling, JS, or other page content changes are made on the WordPress site server, only to find that the change doesn't work after refreshing the page locally.

In many cases we can fix this by forcing a page refresh, but sometimes it doesn't work.

In this case, you may need to clear the local DNS cache.

How to force refresh to clear Windows10/MAC/Linux/CentOS DNS cache? In this article, we will explain in detail how to clear/flush DNS cache this practical trick, I hope it will help you!

What is DNS?

DNS stands for Domain Name Server.When a website or web application is hosted on a server, whether it is based onLinuxOr Windows, will be assigned a specific series of decimal-separated numbers, which are technically IP addresses. DNS is like the English translation of these numbers.

How does DNS work?

When you enter a website address in a web browser, it looks up its DNS, which is assigned to the domain name on the domain name registrar's website.

It is then converted to the assigned IP address and the request back to the website is sent to the server corresponding to the DNS, thus obtaining the IP address.

How does DNS work?2nd

The reason for explaining how DNS works is to make it easier for you to understand how DNS caching works.

To improve response time, web browsers store the DNS addresses of websites you have visited, a process called DNS caching.

Therefore, if the website owner has migrated the website to another server with the new DNS (or IP address), you may still see the website on the old server because your local computer has the old server's DNS cached.

To get the latest website content from the new server, you will need to clear your local computer's DNS cache.Sometimes the cache is stored for a long time and you will not be able to see new website content until the cache is cleared.

The DNS thing (backend process) is completely invisible to us on a daily basis, unless you find that the changes on the website are not showing as usual.

So if you've migrated your website to a new server and made some changes on your website, but you can't see those changes on your local computer, one of the first diagnostic steps you need to take is to flush DNS.

You can do this at the browser level as well as the OS level using the flush command.

We explain this process in more detail in the following sections.

How to force refresh of website page content via web browser?

Before flushing DNS, you can try to force flush the webpage you want to visit.This will clear the webpage cache and help the browser find updated files for the webpage.

  • Windows operating system:Internet Explorer, Microsoft Edge, Mozilla Firefox or Google ChromeGoogle Chrome, use the key combination "Ctrl + F5".
  • Apple/MAC computers:Mozilla Firefox or Google Chrome, use the key combination "CMD + SHIFT + R".If you use Apple Safari, use the key combination "SHIFT + Reload".

You can also try accessing the page using incognito mode (Chrome) or a private window (Firefox).

After completing the forced refresh of the page content, we will perform the DNS cache clearing work again.The process of clearing the cache depends on your operating server and browser. The following is a specific operation tutorial.

How to clear DNS cache on Windows 10 operating system?

Enter command prompt mode and clear cache on Windows OS.

  1. Use keyboard key combinations:Windows+R
  2. Pop up the Run window▼How to clear DNS cache on Windows 10 operating system?Enter command prompt mode and clear cache on Windows OS.Use the keyboard key combination: Windows+R to pop up the Run window No. 3
  3. Type in the input box:CMD
  4. Press Enter to confirm and a Command Prompt window will open.
  5. enter ipconfig/flushdns and press Enter▼How to clear DNS cache on Windows 10 operating system?Type: CMD in the input box and press Enter to confirm, a command prompt window will open.Type ipconfig/flushdns and press Enter sheet 4
  6. The window prompts the successful information of DNS Flush▼How to clear DNS cache on Windows 10 operating system?The window prompts the success information of DNS Flush No. 5

How to clear DNS cache on MAC OS (iOS)?

Click Utilities under Go in the top navigation bar of the MAC machine▼

How to clear DNS cache on MAC OS (iOS)?Click Utilities under Go in the top navigation bar of the MAC machine Sheet 6

Open Terminal/Terminal (equivalent to the command prompt of the WIndows operating system)▼

How to clear DNS cache on MAC OS (iOS)?Open Terminal/Terminal (equivalent to the command prompt of the WIndows operating system) Sheet 7

Execute the following command to clear the DNS cache on your computer▼

sudo killall -HUP mDNSResponder && echo macOS DNS Cache Reset

The above commands may vary by OS version as follows:

1. Mac OS Sierra, Mac OS X El Capitan, Mac OS X Mavericks, Mac OS X Mountain Lion, Mac OS X Lion operating system use the following command ▼

sudo killall -HUP mDNSResponder

2. For Mac OS X Yosemite, use the following commands ▼

sudo discoveryutil udnsflushcaches

3. Use the following command for Mac OS X Snow Leopard ▼

sudo dscacheutil -flushcache

4. For Mac OS X Leopard and below, use the following commands▼

sudo lookupd -flushcache

How to clear DNS cache on Linux OS?

step 1:On Ubuntu Linux and Linux Mint, use the keyboard combination Ctrl+Alt+T to open a terminal

Step 2: After launching the terminal, enter the following command code▼

sudo /etc/init.d/networking restart

How to clear DNS cache on Linux OS?Step 1: On Ubuntu Linux and Linux Mint, use the keyboard combination Ctrl+Alt+T to open a terminal Step 2: After launching the terminal, enter the following command code Sheet 8

  • It may ask for an administrator password.

Step 3: Once successful, it will display a confirmation message like this ▼

[ ok ] Restarting networking (via systemctl): networking.service

step 4:If DNS Flush is unsuccessful, follow the steps below.

step 5:Enter the following command in the terminal ▼

sudo apt install nscd
  • After completing the above command, repeat steps 1 to 4.

how to clearCentOSDNS cache on?

Use the keyboard combination Ctrl+Alt+T to open the terminal.

Enter the following command ▼

nscd -i hosts

To restart the DNS service, enter the following command ▼

service nscd restart

How to clear DNS cache on Google Chrome?

Clear the DNS cache in Chrome, open the Google Chrome browser.

In the address bar, enter the following address ▼

chrome://net-internals/#dns

It will show the following options ▼

How to clear DNS cache on Google Chrome?Clear the DNS cache in Chrome, open the Google Chrome browser.In the address bar, enter the following address ▼ chrome://net-internals/#dns and it will show the following options #9

Click the "Clear host cache" button.

How to clear DNS cache in Firefox?

Go to Firefox History and click on the Clear History option ▼

How to clear DNS cache in Firefox?Go to Firefox History and click on the Clear History option sheet 10

If desired, select Cache/Cache (and other related options) and click the Clear Now button ▼

How to clear DNS cache in Firefox?Select Cache/Cache (and other related options) if desired, then click the Clear Now button Sheet 11

 

How to clear DNS cache in Safari?

Go to the Advanced Settings option under Preferences ▼

How to clear DNS cache in Safari?Go to the Advanced Settings option under Preferences sheet 12

  • Select the option "'Show Develop menu in menu bar'" ▲

It will show the Develop menu in the browser menu options▼

How to clear DNS cache in Safari?It will show Develop menu sheet 13 in browser menu options

Under Development, find the Empty Caches option ▲

  • This will clear the DNS cache.
  • Alternatively, if you want to clear the cache completely, you can directly click "Clear History" under the "History" menu option of Safari browser

How to clear DNS cache in Internet Explorer?

Click on the icon (…) in the upper right corner, then click on “Settings” ▼

How to clear DNS cache in Internet Explorer?Click on the icon (…) in the upper right corner, then click on “Settings” Sheet 14

Click the "Choose what to clear" option under Clear browsing data ▼

How to clear DNS cache in Internet Explorer?Click the "Choose what to clear" option under Clear browsing data Sheet 15

Select the Cached Data and Files option from the menu ▼

How to clear DNS cache in Internet Explorer?Select the "Cached data and files" option from the menu Sheet 16

 

Conclusion

Depending on your computer's operating system and browser, you can use one of the above methods if you encounter any problems.
To refresh your website to get the latest data, usually we can also do this:

  1. Try to force refresh the webpage (Ctrl F5)
  2. Use the "Clear Browsing Data" option in your browser settings (as aboveSaidstep)
  3. Flush your operating system's DNS (using the command prompt above).
  4. Restart your router to reset your internet connection.

In general, the above steps can solve the problem that most people encounter the latest content of the page not refreshing.

If after following the above steps, the problem still cannot be solved, it is recommended that you technically contact your website server provider for support.

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "How to Force Refresh to Clear Windows10/MAC/Linux/CentOS DNS Cache? , to help you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-1275.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

Comment

Your email address will not be published. Required fields * Callout

scroll to top