How to Flush DNS Cache on MacBook: Terminal Command
Flushing DNS cache on a MacBook requires opening Terminal and running `sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder`. Enter your administrator password when prompted. This command works on macOS Monterey, Ventura, and Sonoma. Older macOS versions may use slightly different commands, but this two-part command covers most modern Mac systems.
I am not going to tell you why you would need to flush your DNS cache (you will know if you need to). So, to flush DNS on a mac simply fire up Terminal and run the following sudo command:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder