I have two VMs in a private cloud. Lets call them A( and B ( (not actual ips). I used one of them(A) as a template and cloned the second one(B) only changing the ips (static ips).

From my local machine on the network, I am able to ping both 90 & 91. Even running ip a on both machines give the correct Ip addresses.

I even checked /etc/hosts and the info is correct.

However, when i run hostname -i or hostname -f on the machine with Ip as 91, I get the result as

I suspect this has something to do with the cloning process.

My question is however, How do i fix the issue on machine 2(


What is the content of /etc/hostname? Have you tried using hostnamectl --set-hostname B to change the hostname/IP?

  • i manually changed the contents of /etc/hostname. I did not believe that was the right way to do stuff which is why i asked the question. But the command you suggested worked, but i believe the option does not have the leading double hyphen. Its hostnamectl set-hostname B. – rapidclock Sep 13 '18 at 19:59

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.