0

After I enter sudo command in command-line it shows this error :

unable to resolve host linux98

linux98 is my PC name. i have tried these solution too : Error message when I run sudo: unable to resolve host (none) and Error message when I run sudo: unable to resolve host (none) but it did'nt solve my problem. please help me !

1
  • 2
    Could you include in your question the contents of /etc/hostname and /etc/hosts, please?
    – anonymous2
    Jun 22, 2016 at 14:17

1 Answer 1

1

That error shows up if you changed host name and /etc/hosts was not changes.

/etc/hosts will have 7 lines. You need to alter the 2nd word on the 2nd line to 127.0.0.1 linux98.

You will need to use a live session since /etc/hosts needs sudo to be able to save changes (sudo nano /etc/hosts) and if sudo complains ... not going to work.

1
  • Should we reboot tha node afterwards?
    – alper
    Jul 9, 2021 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .