Still struggling here.
I’ve got the sudo thing. I’ve been able to edit the hosts file. Or I think I have. After using gedit (started from terminal) to edit the file, I issue =cat hosts= and the file types out just the way I expect it to. But whenever I restart the system, which I’ve unfortunately had to do many times, the hosts file reverts to the original. (I’ve done nothing but restart and open a terminal and go =cat hosts= and my changes are always gone.) I also once put a copy of the edited file on my desktop, and it was gone after a restart. Something always seems to go wrong after I change the hosts file so I cannot even get to try to download my utilities. Usually windows start greying and then things start disappearing. It appears that something is trying to recreate the disappeared stuff, but whenever it does things are missing (like my internet connection). I thought this was going to be easy!
The alternative I can think of is don't restart your system right after editing the hosts file.
Instead, restart the network service:
should do the trick in terms of getting your hosts file to behave properly. I've not heard of the file reverting upon a reboot, unless the system is re-writing it upon startup.
Oh--wait a second.
You're running Ubuntu off of your USB stick, right? The /etc directory exists solely in RAM--not on your stick. What you are editing is a temporary copy of the hosts file--not the one installed by the rescue stick.
So--I'm not an expert here, though I've done this once or twice. Look for a directory called something like "/mnt/sysimage/etc" or similar. The file you want to edit will be in there.
Type in the following:
find / -iname /etc/hosts
and see if that returns anything other than /etc/hosts.