What's the cause / reason of: "unable to resolve host WS24 !?
David Curtis
dcurtis at uniserve.com
Sat Apr 26 21:49:23 UTC 2008
Marius Gedminas wrote:
> On Sat, Apr 26, 2008 at 08:53:07AM +0800, SYNass IT Ubuntu / Linux wrote:
>> On Sat, 2008-04-26 at 12:31 +1200, Tim wrote:
>>> On Fri, 2008-04-25 at 20:56 +0800, SYNass IT Ubuntu / Linux wrote:
>>>> Hi Linux / Ubuntu experts and cracks
>>>> My wife's notebook has Hardy 8.04-RC / LTS installed.
>>>>
>>>> At systemboot menu.lst shows 2 sets of bootables and
>>>> I wanted to mark one of the sets with # to avoid displaying.
>>>>
>>>> This happens:
>>>>
>>>> xyz at WS24:~$ sudo gedit /boot/grub/menu.lst
>>>> sudo: unable to resolve host WS24
>>>> xyz at WS24:~$
>>>>
>>> Can you run other commands via sudo? The error suggests
>>> that /etc/sudoers has a reference to an unknown host in it.
>>>
>>> Are you sure about the error message -the subject line references WS24,
>>> an d so do the shell prompts in the text, but the error message above
>>> references WS123 (have you edited the host name in the messages?)
>> Thanks and sorry, Tim !
>> My mistake & typo, all should be and are WS24 !!
>
> sudo is very unhappy if it cannot resolve the system hostname. The fix
> is to make sure /etc/hosts has an entry for the hostname. In your case
> the top of the file should look like this:
>
> 127.0.0.1 localhost
> 127.0.1.1 WS24
>
>
> Now, editing /etc/hosts is difficult if sudo doesn't work for you. You
> may need to boot in rescue mode to get a root shell and use a text-mode
> editor (nano is simple and user-friendly, vi is complex and beloved by
> experienced admins).
>
> Cheers,
> Marius Gedminas
>
It has been reported in lauchpad and the forums that 'gksu gedit
/etc/hosts' should work. Also from the menu: System > Administration >
Network > Hosts.
I don't have this problem, so if the above is incorrect please inform.
HTH,
Dave.
More information about the ubuntu-users
mailing list