The method for clearing or flushing the local cache in Mac OS has changed over the years. Here are all the Mac OS versions on one page that details how to clear Mac OS DNS cache via command line.
Clear your DNS cache on macOS Tahoe 26, macOS Sequoia 15, macOS Sonoma 14, macOS Ventura 13, macOS Monterey 12, macOS Big Sur 11, macOS 10.15 Catalina, macOS 10.14 Mojave, macOS 10.13 High Sierra, macOS 10.12 Sierra, OS X 10.11 El Capitan, OS X 10.10 Yosemite, OS X 10.9 Mavericks, OS X 10.8 Mountain Lion, OS X 10.7 Lion, OS X 10.6 Snow Leopard, and OS X 10.5 Leopard using the following Terminal commands:
