Linux: Set the hostid on a system?
Solution 1:
Assuming here what your referring to is the tradiitional unix hostid. If I wanted to bind software to a system I would use a dongle or some stronger means to identify a system seeing as a hostid is very arbitrary, but nevertheless..
The hostid is retrieved using the library call "gethostid". Its merely a generic value which, if unset will be based off of the ipv4 address of the host system.
See "man 2 gethostid"
In the glibc implementation, if gethostid() cannot open the file containing the host ID, then it obtains the hostname using gethostname(2), passes that hostname to gethostbyname_r(3) in order to obtain the host's IPv4 address, and returns a value obtained by bit-twiddling the IPv4 address. (This value may not be unique.)
You can set it yourself to anything you want by putting the file /etc/hostid in place with the value you want (presumably thats the same as what comes out of the 'hostid' program on your donating box).
To set it is a little tricker though.. the file required a packed binary representation of the hostid.
I used python but you can do whatever.. (pretty sure someone knows an easier means to print packed bytes).
from struct import pack
f = open('/etc/hostid', 'w')
f.write(pack('i', 12345))
f.close()
This will set the hostid in a manner for which gethostid will return the same value as the donating box as the migrating box.
Solution 2:
Afaik the hostid is either the MAC address of the (primary?) network card, or some kind of mixed identifiers with other values such as ip addresses (this heavily depends of the kind of *nix you run).
I guess, it should be possible to "fake" this value on any system (at least the mac address can be overridden). However, the best way is to ask the software vendor to transfer the license to the new system. I see no good reason why this should not be possible.