Hostname prefix


Is there a way, or what would be a good approach to create a way, to set a prefix for the container hostname autogenerated by Docker?

At this moment the container hostnames are automatically generated when creating/launching a container.
One can use the “–hostname” parameter when starting a container. Tthis gives you a full and fixed hostname, unless you create a script which generates the hostname and runs the container.
The only way I found to change a hostname involves some trickery outside of Docker.
Both options are unfortunately not an option due to constrains within the existing environment in which Docker is used now.

I’ve got the issue where the validity of a license depends on the hostname, or at least the predictability of it. Having a way to set a prefix, which is then extended with the usual hash, would solve the problem.

How does the hostname get generated and set now? Would it be possible to alter this process from within the container?
Do I have other options to achieve the desired result?
Would it be an option to add a hostname prefix parameter to Docker?