In Linux, there are multiple ways to do this depending on the caching daemon you’re running (nscd, dnsmasq, etc..). I will defer to this askubuntu question for the best explanation of all scenarios but will outline the most common below:

sudo /etc/init.d/dns-clean restart

OR

sudo service dns-clean restart

Mac OS X

dscacheutil -flushcache

Windows (pretty much all of them):

ipconfig /flushdns
Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.