I have a message saying:"sudo: unable to resolve host (myhostname)" each time i write a command. My hostname do not contain any capital letter or number. thank you
Asked
Active
Viewed 1.9k times
6
1 Answers
6
Sometimes, even if you've changed the host name via raspi-config
, the settings don't stick. To make it permanent:
sudo nano /etc/hosts
and change the line that says
127.0.1.1 raspberrypi
to
127.0.1.1 myhostname
assuming that myhostname is the name you want to use. Save, exit and reboot, and the message will go away.

scruss
- 9,068
- 1
- 24
- 35
/etc/hosts
contain an entry like127.0.1.1 myhostname
? – joan Apr 07 '17 at 21:11raspi-config
you would not probably have had the problem you originally posted. – Milliways Apr 07 '17 at 23:46127.0.1.1 raspberrypi
line for me – scruss Dec 13 '17 at 17:48