DNS Flush

Is sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder safe to perform a dns flush on my Mac air using mac0s 26.6.1?


MacBook Air 13″, macOS 26.6

Posted on Aug 19, 2026 8:16 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 20, 2026 4:57 AM

Before clearing the DNS cache, it is worth asking what problem is occurring and why DNS is suspected.


A DNS flush is a troubleshooting step, not something that normally needs to be done routinely.


If there is a specific DNS-related problem, this command is commonly used on macOS:


sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder


It clears cached DNS information and signals mDNSResponder.


It does not change the DNS servers or other network settings configured on your Mac.


Apple documents DNS configuration under System Settings >> Network >> your network service >>> Details >> DNS. (Apple Support)


A DNS flush may be appropriate when troubleshooting a DNS-resolution problem, but it will not necessarily fix problems caused by the DNS server, router, ISP, VPN, network configuration, browser, or the website itself.


So, before running the command, I would first ask: What problem are you experiencing that led you to think the DNS cache needs to be cleared? 


Knowing the symptom can tell us whether flushing DNS is actually the appropriate next step.


Apple: Change DNS settings on Mac

2 replies
Question marked as Top-ranking reply

Aug 20, 2026 4:57 AM in response to Cadet3

Before clearing the DNS cache, it is worth asking what problem is occurring and why DNS is suspected.


A DNS flush is a troubleshooting step, not something that normally needs to be done routinely.


If there is a specific DNS-related problem, this command is commonly used on macOS:


sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder


It clears cached DNS information and signals mDNSResponder.


It does not change the DNS servers or other network settings configured on your Mac.


Apple documents DNS configuration under System Settings >> Network >> your network service >>> Details >> DNS. (Apple Support)


A DNS flush may be appropriate when troubleshooting a DNS-resolution problem, but it will not necessarily fix problems caused by the DNS server, router, ISP, VPN, network configuration, browser, or the website itself.


So, before running the command, I would first ask: What problem are you experiencing that led you to think the DNS cache needs to be cleared? 


Knowing the symptom can tell us whether flushing DNS is actually the appropriate next step.


Apple: Change DNS settings on Mac

Aug 20, 2026 5:38 AM in response to Cadet3

DNS cache refers to the temporary storage of information about previous DNS lookups on a computer or web browser. Keeping a local copy of a DNS lookup allows your OS or browser to quickly retrieve it and thus a website's URL can be resolved to its corresponding IP much more efficiently.


More info: Change DNS settings on Mac – Apple Support (MY)


It is completely safe to flush your DNS cache on a Mac using the

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

command in Terminal. As with all sudo commands, it will ask for your password but not echo it (nothing will appear on the screen as you type, so be sure to type carefully and correctly then press return).


The process only clears stored website addresses from your system, fixes connection errors, and forces your computer to fetch fresh data. It does not delete personal files or harm your operating system.


It's commonly done because it:

  • Fixes slow or broken websites
  • Clears old server data
  • Resolves network connection errors
  • Updates changed web addresses


Having said that, the process only flushes the DNS cache on your Mac. Your router and your Internet Service Provider also have DNS caches, and this procedure will not affect those.


DNS Flush

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.