I tried the solutions here, and some (like the DNS Hostname Changer app, or using a terminal emulator to "setprop net.hostname") work temporarily, but the only solution that works PERMANENTLY (after a reboot) is to edit your buildprop file,
which requires being rooted.
There are many ways to edit your buildprop file if you're rooted, but I used the free app,
BuildProp Editor (by JR Rummy Apps) to edit the buildprop file. To do this:
1) Launch the BuildProp Editor app.
2) Grant it SuperUser access (through your superuser app, which will probably pop up).
2) Click on the pencil icon to edit the buildprop file.
3) Scroll to the bottom of the buildprop file and tap on an empty line.
4) Type: net.hostname=YourDesiredName (Your Desired Name must use alphanumeric characters, dashes and underscores only. Note that there is no space on either side of the equal sign.)
Alphanumerics, dashes, and underscores are OK.)
5) Click on the "save" icon at the top. (It looks like a
floppy disk. Who remembers those?)
6) Select "Save & Exit".
7) Reboot the phone.