Re: Unable to ping hostname?

From: David Efflandt (efflandt_at_xnet.com)
Date: 11/28/03


Date: Fri, 28 Nov 2003 03:03:32 +0000 (UTC)

On Fri, 28 Nov 2003, Robert Mark Bram
<relaxedrob@remove.this.optusnet.com.au> wrote:
> I have used hostname to give my computer a name, yet I am unable to ping
> it:
>
> $ cat /etc/hosts
> # Do not remove the following line, or various programs
> # that require network functionality will fail.
> 127.0.0.1 localhost.localdomain localhost
>
> ~
> $ hostname
> dijong
>
> ~
> $ ping dijong
> ping: unknown host dijong
>
> Should the hostname appear in the hosts file? I am using DHCP to obtain an
> IP address..

It would only be in the hosts file if you put it there. Since you
apparently do not have a static IP to assign it to, you could use an extra
loopback IP (see: man hosts):

127.0.0.2 dijong.localdomain dijong

-- 
David Efflandt - All spam ignored  http://www.de-srv.com/


Relevant Pages

  • Re: Unable to ping hostname?
    ... > I have used hostname to give my computer a name, yet I am unable to ping ... > $ ping dijong ... > ping: unknown host dijong ...
    (linux.redhat)
  • Unable to ping hostname?
    ... I have used hostname to give my computer a name, yet I am unable to ping ... $ ping dijong ... ping: unknown host dijong ...
    (linux.redhat)
  • Re: Ping always resolves to a specific ip, but nslookup resolves properly
    ... > On a specific system running Windows 2000 Professional, ... > running ping on a specific hostname in our network returns ... Ping always points to the wrong ip ... I looked into the hosts file and the lmhosts file. ...
    (microsoft.public.win2000.networking)
  • How windows 2003 network works ?
    ... I recently meet a problem, when I ping a hostname,the ping program just ... I'm sure it's a valid hostname which ever exists in the hosts file. ... Prev by Date: ...
    (microsoft.public.win2000.networking)
  • Re: Cant see out to .co.uk from inside my .local domain (forward l
    ... Well I removed the entry from my hosts file and issued a ping command to both ... network only from the server which I changed the hosts file for. ... Indeed is it even a DNS issue. ...
    (microsoft.public.windows.server.sbs)