This is a very simple and quick way, to set unique linux hostname, when getting address from DHCP.It's based on the dhclient-exit-hooks, so all you need to do is to create a bash script in /etc/dhcp/dhclient-exit-hooks.d

In this case, hostname is a combination from a static word and last octet of the assigned IP address. If you are getting address hostname will look like this: server-10



if [ "$reason" != BOUND ] && [ "$reason" != RENEW ] \
   && [ "$reason" != REBIND ] && [ "$reason" != REBOOT ]

echo dhclient-exit-hooks.d/hostname: Dynamic IP address = $new_ip_address
hostname=server-$(echo $new_ip_address | cut -d '.' -f 4)

echo $hostname > /etc/hostname

hostname $hostnamey

echo dhclient-exit-hooks.d/hostname: Dynamic Hostname = $hostname

You can easyly put your own script, to change the hostname for random values, or something that will fit your needs. In this case I have a dedicated subnet range, for new machines with this hook.