Currently my dhcp-log displays my Raspberry Pi with the name
xbmc-e0cb. Can I change this to a more sensible name?
Update the host name in the following files
Change the name, and it will change on network-restart (or full reboot, of course).
/etc/hosts is necessary to avoid the following error
sudo: unable to resolve host <new-hostname>
I did this, adapted from http://forum.stmlabs.com/showthread.php?tid=7180
sudo nano /scripts/nm_util.py
Almost at the bottom of the file, uid is set. Comment out all of the if clause, and change it to
uid = "MyHostname"
Additionally you can change the hostname on the fly by issuing the commang
sysctl kernel.hostname=NEW_HOSTNAME. But that is no permanent solution. @René Wolferink already posted the only permanent way.
With the introduction of systemd (Raspbian Jessie and newer), the prescribed method is finally a single command (reference):
sudo hostnamectl set-hostname <mymachine>
Changes take effect immediately and persist after reboot.