While we are on the subject of flushing DNS cache, here is how you do it in MacOS.

dscacheutil -flushcache