Generating a random hostname
psteele at maxiscale.com
Thu Mar 18 11:57:59 UTC 2010
>Thinking about this some more, a good trick would be to generate a hostname from the MAC address of the host, since that is guaranteed to be unique.
In fact, this is what we are currently using. Unfortunately I guess I wasn't entirely clear. I was looking for a facility that actually *assigns* a random hostname, similar to what's provided in Windows. Generating the string itself obviously can be done in any number of ways, but once you have the string, there are at least of couple of files where this name needs to be inserted (/etc/hosts, /etc/rc.conf). When you create a master image in Windows, you can have it automatically assign a random hostname the first time the cloned image is booted. That's what I was looking for. My guess is that I'm going to have to update these files manually, running a script for example via rc.conf that disables itself after the first time the system boots.
More information about the freebsd-questions