answer from serverfault:
One simple way that comes to mind without setting up things in DHCP.
Assuming there is a web site you can add files to. Place the hostname inside a file based on the Mac. Then retrieve it with wget.
mac=`ifconfig eth0 | grep HWaddr | sed 's/^.*HWaddr //; s/://g'`
wget -O hostname.txt http://www.example.com/$mac
hostname `cat hostname.txt`
The mac file name would be in lower case with no colon (