In ubuntu if you want to flush DNS cache you need to restart nscd daemon
Install nscd using the following command
sudo apt-get install nscd
Flush DNS Cache in Ubuntu Using the following command
sudo /etc/init.d/nscd restart
OR
sudo /etc/init.d/dns-clean start
Reference: http://www.upubuntu.com/2012/05/how-to-flush-clear-dns-cache-under.html