Hostname getting changed is a serious issue, it will result in the termination of your pods running on that particular node, so you need to take care while creating your cluster and assign fixed hostnames to your nodes. In general even though the IP gets changed the hostname should remain constant except if someone overrides the existing hostname or if someone adds multiple hostnames in the same machine or node.
Check whether there are any conflicting entries in the hostnames file, remove them accordingly and restart the kubelet service, if the issue still persists use the below commands:
Using the kubectl command, list all the existing nodes and try to differentiate the old nodes from new nodes.
After differentiating the old nodes, delete them by using the following command and this will solve the issue for you.
kubectl delete node <hostname>