Let's look at Linux Man page:
http://linux.die.net/man/2/gethostid
"In the glibc implementation, the hostid is stored in the file /etc/hostid. (In glibc versions before 2.2, the file /var/adm/hostid was used.)
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.)"
So going by this, unless you have defined static hostid by creating /etc/hostid file, if your IPv4 address change, it will almsot certainly result in different hostid.
I have also verified this in my setup.