Works like it says on the tin Rated 5 out of 5 stars

This works as specified. A cool enhancement would be to use file alteration monitoring (inotify or the equivalent on other OSes) to detect changes to the /etc/hosts file and clear the cache automatically.