Ubuntu: how to correctly change machine name? [duplicate]



Question:

This question already has an answer here:

I've changed my machine name through editing /etc/hostname file. but since I did, a weird message appears whenever I sudo:

sudo: unable to resolve host Tehuti  

then it asks for password normally.

What is wrong and is there a correct way to change name with causing problems?


Solution:1

Check in your hosts file(/etc/hosts), for the entry of 127.0.1.1 Set your new hostname there as well. So probably for you:

127.0.1.1 Tehuti


Solution:2

You have to edit /etc/hosts too. Replace old name with new name.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »