macOS Open the terminal window. If you’re using Mac OS Sierra, X El Capitan, X Mavericks, X Mountain Lion, or X Lion, enter the following command: sudo killall -HUP mDNSResponder To flush DNS cache on Mac OS X Yosemite, enter the statement: sudo discoveryutil udnsflushcaches Linux Ubuntu does not cache DNS entries. However, if you have manually installed a DNS service, such as name service caching daemon then you can periodically flush the DNS cache. The method provided below will show you how you can flush your DNS cache.