The sad state of affairs with hostid and gethostid() on Linux is somehow described in <URL: https://bugs.debian.org/595790 >. The zfs package have a workaround creating /etc/hostid to make sure it do not change every time dhclient update the IP address of the machine.
-- Happy hacking Petter Reinholdtsen