complete dns flush code example Example 1: flush dns sudo killall -HUP mDNSResponder Example 2: flush dns /etc/init.d/nscd restart