Open the Terminal application, found in the Utilities folder within Applications.
Enter the following command syntax exactly:
sudo killall -HUP mDNSResponder;say DNS cache has been flushed
Or if that fails, you can try:
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say MacOS DNS cache has been cleared