There may be some occasion that you want to bypass hostfile to resolve public IP, how it works?
here is small example, host command works exactly as dig. (ie. doesnot do byhostname lookup)
host www.ashishnepal.com -> will look directly to DNS (not looking host file same as dig)
getent hosts www.ashishnepal.com -> will look into /etc/hosts file first and go to DNS.