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

  • 1
    Does /etc/hosts contain an entry like myhostname? – joan Apr 7 '17 at 21:11
  • Thank you, i added myhostname in this file and the message went disappered. – Niz.Dam Apr 7 '17 at 22:53
  • I have another problem it concerns the Wifi. i can't really connect to my router, i added my connection information in /etc/wpa_supplicant/wpa_supplicant.conf and changed /etc/network/interfaces. – Niz.Dam Apr 7 '17 at 22:57
  • Also, the wifi icon mentions Wlan0 " No wifi interfaces found" – Niz.Dam Apr 7 '17 at 22:58
  • "changed /etc/network/interfaces" is probably your problem DO NOT MODIFY See How do I set up networking/WiFi/Static IP Also if you changed your hostname using raspi-config you would not probably have had the problem you originally posted. – Milliways Apr 7 '17 at 23:46

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       raspberrypi

to       myhostname

assuming that myhostname is the name you want to use. Save, exit and reboot, and the message will go away.

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.