The macOS stores the name resolution information like computer hostnames, account user names, group names, and others as the DNS cache. It helps to considerably quicken the project’s load times as the IP addresses for the queried domains are stored in the cache. The DNS cache allows the system to answer queries more directly rather than rerouting to DNS servers.
To Flush DNS on macOS
1. Open Applications and go to Utilities or press Command+Space. It will launch Spotlight.
2. Search for the Terminal application by entering Terminal in the Search box.
3. Run the terminal.app
4. Enter:
sudo killall -HUP mDNSResponder
5. Press the Return button on the keyboard.
6. Enter the administrator password of the account and press the Return key.
Note: You can enable an audio notification to confirm if the DNS flush is complete or not. You have to type say and enter a notification message after you type the command.
For Example,
sudo killall -HUP mDNSResponder; say dns is flushed successfully