LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How can I ping my linux system by host? (http://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-ping-my-linux-system-by-host-46254/)

hydro 02-19-2003 11:25 PM

How can I ping my linux system by host?
 
Hey guys

i have two entries in my etc/hosts file

127.0.0.1 localhost
192.168.0.2 Apophis

Apophis(stargate fan) is the hostname of the linux system and that ip is the ip the router gives it

with all my windwos system, i can ping them all by using there host name "ping comp-bla"

how can i do the same for linux?

i look at my router dhcp table and nothing is set for 192.168.0.2

micxz 02-19-2003 11:39 PM

Use the ping command:

mars:/home/micxz # ping 192.168.0.2
PING 192.168.0.2 (192.168.0.2) from xxx.xxx.xxx.xxx : 56(84) bytes of data.

--- 192.168.0.2 ping statistics ---
5 packets transmitted, 0 received, 100% loss, time 3999ms

hydro 02-20-2003 12:35 AM

read the title man

i said by hostname
HOST

not ip :/

PTBmilo 02-20-2003 02:07 AM

Code:

/home/milo [201]> ping Apophis
and make sure that you /etc/nsswitch.conf file has:
Code:

hosts:          files dns
The /etc/hosts file has this syntax:

IP_address canonical_hostname aliases

example(from 'man hosts'):
127.0.0.1 localhost
192.168.1.10 foo.mydomain.org foo
192.168.1.13 bar.mydomain.org bar

hydro 02-20-2003 03:19 AM

:/

I need my linux system to register its hostname with the router dhcp.

so i can ping it using its hostname from other pcs on the network

PTBmilo 02-20-2003 03:31 AM

I thinnk you might need BIND.... dns server.

micxz 02-20-2003 03:48 AM

I've got to learn how read':

Mine reads:

127.0.0.1 localhost
10.10.10.1 mars.local mars

Mars resolves and mars.local as well' Hope this helps'


All times are GMT -5. The time now is 02:53 AM.