how to clear dns cache in linux code example Example 1: flush dns cache linux sudo systemd-resolve --flush-caches Example 2: clearing dns cache ipconfig /flushdns