What's the cause / reason of: "unable to resolve host WS24 !?

Marius Gedminas marius at pov.lt
Sat Apr 26 01:57:39 UTC 2008


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
-- 
TCP_UP - The 16-bit TCP Urgent Pointer, encoded as the hex
      representation of the value of the field.  The hex string MUST be
      capitalized since it is urgent.
                -- RFC 3093
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20080426/5888c10e/attachment.sig>


More information about the ubuntu-users mailing list