Support >
  About cybersecurity >
  Why are changes to the DNS server not taking effect? ​​How to refresh the local DNS cache?

Why are changes to the DNS server not taking effect? ​​How to refresh the local DNS cache?

Time : 2026-06-04 14:21:47
Edit : DNS.COM

  Many website owners have encountered this situation: you've changed the DNS server address with your domain registrar, and the system indicates a successful change, but after waiting for half a day, or even a day or two, the website is still inaccessible, or it's accessible intermittently. Frankly, this in-between state is incredibly frustrating. You think you've changed it, but it hasn't taken effect; you think you haven't changed it, but the settings show it's been changed.

  In most cases, the problem isn't with domain name resolution itself, but rather that your local computer's DNS cache is still "remembering" the old one. It's like moving house; your old neighbor still remembers your old address and will naturally go to the wrong place.

  Let's start with a basic concept: what exactly is DNS resolution?

  Simply put, every server on the internet has a numerical address, or IP address, like 192.168.1.1. But humans can't remember these numerical strings, so we have domain names, like baidu.com. DNS servers are responsible for translation; you enter a domain name, and it finds the corresponding IP address for you. When you change a domain's DNS server, this change first needs to gradually spread throughout the global DNS system. This process can take up to 48 to 72 hours, but in reality, it usually takes only a few hours.

  The problem is that even after the global DNS system has been updated, your computer might still be stuck. This is because, to improve efficiency, the operating system temporarily stores previously retrieved DNS results—this is DNS caching. Until the cache expires, your computer won't query the new DNS server, naturally making it feel like the "change hasn't taken effect."

  Therefore, the most direct and effective method is to force-refresh your local DNS cache.

  The method varies slightly depending on the operating system, but it's not difficult.

  Windows systems are probably the most common. Simply press the Win key and R key on your keyboard to bring up the Run window, type cmd, and press Enter. In the pop-up command window, type the following command:

ipconfig /flushdns

  After typing, press Enter. If you see the message "DNS resolution cache successfully refreshed," it means the cache has been cleared. Then try accessing your website again; it will most likely work normally.

  By the way, this message may vary slightly between different Windows versions; some display it in English, others in Chinese, but the meaning is the same.

  Mac systems are slightly more complicated, depending on the year of your system. For newer Macs, open Terminal (found in the "Other" folder in Launchpad), and type:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

  After typing, press Enter. Because of the `sudo` directive, the system will ask for your password. Note that asterisks won't appear on the screen while you're typing; just type it and press Enter. Older Mac versions may have different commands, but if you're using macOS 10.10 or later, the above command is sufficient.

  For Linux systems, commands vary significantly between different distributions. Common ones include:

sudo systemd-resolve --flush-caches

 or

sudo resolvectl flush-caches

  If you're unsure what version of Linux you're using, try both methods; one should work.

  Now, let's talk about browsers. Many people don't know that browsers like Chrome and Edge also have their own DNS cache. Sometimes, even after you've cleared your system cache, the browser might still be using it.

  For example, with Chrome, you can enter the following in the address bar:

chrome://net-internals/#dns

  Then click the "Clear host cache" button on the page to clear it. The process is similar in Edge browser; use edge://net-internals/#dns.

  However, sometimes the problem isn't actually the cache.

  One easily overlooked situation is that although your domain's NS record (i.e., DNS server record) has been changed, the old DNS server is still providing resolution services. This is like porting your phone number; the operator's system shows you've switched, but a salesperson is still sending you text messages using the old method.

  Once the global DNS cache expires, everything will be normal. But if you can't wait that long, you can manually check what the domain's current NS record has become. Many online tools show this by entering your domain name. If the displayed information doesn't match your recent changes, it means the changes haven't fully spread.

  Another common misconception is that many people change the DNS server settings but forget to change the DNS resolution record itself. These are two different concepts. DNS servers act as "translation agencies" responsible for resolving your domain names, and the DNS records (such as A records and CNAME records) are like the "translation dictionary" held by these agencies. If you change your translation agency, but the new agency doesn't have your dictionary yet, or the addresses in the dictionary are incorrect, then naturally, you won't be able to access your website.

  Therefore, the correct procedure for changing your DNS server settings is: first, add your domain name to your new DNS service provider's network, configure all the DNS records correctly, and then change the DNS server address at your domain registrar. This order is crucial; if you do it in reverse, there will be a gap in the process, and your website will be completely inaccessible.

  There are also some more subtle reasons, such as DNS hijacking by your ISP.

  China's network environment is unique. Some broadband ISPs forcibly cache DNS results or even tamper with DNS records. In this case, refreshing your local DNS settings won't help because the problem lies with the ISP. The solution is simple: change your computer's or router's DNS to a public DNS server, and after doing so, remember to refresh your local DNS cache. This should bypass the ISP's annoying practices.

  Finally, here's a little-known fact: Sometimes you can't access your own website, but others can. In 99% of cases, this is a problem with your own computer, either the cache or the hosts file. If you've previously modified your hosts file (located in the C:\Windows\System32\drivers\etc directory), it might contain old manually specified records, which have higher priority than DNS records. Check it, and delete any that exist.

  Ultimately, dealing with DNS changes not taking effect requires patience, but you can't just sit around waiting either. Troubleshoot in order: first, check if the NS records have been updated; then, refresh your local DNS cache; next, check if the new DNS provider's resolution records are configured correctly; finally, check if your ISP is interfering. This combination of steps will solve 99% of the problems.

  The remaining 1%? That might be due to a delay in the registrar's system, or it might be during global DNS root server maintenance. In this case, you can only wait, have a cup of tea, and try again in a few hours. After all, the internet is essentially a system composed of countless machines, and machines sometimes get lazy; you have to give them time to react.

DNS Luna
DNS Amy
DNS NOC
Title
Email Address
Type
Information
Code
Submit