When you firs boot up, pich the rescue option from grub menu and you should drop right to a rootshell, you can edit /etc/hosts from there.
Alternatively;
press 'e' on the option you normally boot from,
from the next menu choose the line that begins with 'kernel .. '
press 'e' again to edit that line...
delete 'quiet splash' from the end and type 'init=/bin/bash' instead.
When you've done that, press enter then 'b' to boot.
After a few seconds you'll be in bash with a root prompt.
# mount / -o remount,rw
# nano /etc/hosts
make sure there's a line that reads "
127.0.1.1 hostname", then save it.