LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-19-2003, 11:25 PM   #1
hydro
Member
 
Registered: Feb 2003
Distribution: Slackware 9.0
Posts: 82

Rep: Reputation: 15
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
 
Old 02-19-2003, 11:39 PM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
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
 
Old 02-20-2003, 12:35 AM   #3
hydro
Member
 
Registered: Feb 2003
Distribution: Slackware 9.0
Posts: 82

Original Poster
Rep: Reputation: 15
read the title man

i said by hostname
HOST

not ip :/
 
Old 02-20-2003, 02:07 AM   #4
PTBmilo
Member
 
Registered: Jan 2003
Posts: 167

Rep: Reputation: 30
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
 
Old 02-20-2003, 03:19 AM   #5
hydro
Member
 
Registered: Feb 2003
Distribution: Slackware 9.0
Posts: 82

Original Poster
Rep: Reputation: 15
:/

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
 
Old 02-20-2003, 03:31 AM   #6
PTBmilo
Member
 
Registered: Jan 2003
Posts: 167

Rep: Reputation: 30
I thinnk you might need BIND.... dns server.
 
Old 02-20-2003, 03:48 AM   #7
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
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'
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to ping my linux host from windows box prabulinc Linux - Networking 2 08-27-2005 02:32 PM
ping host unreachable czyang4 Linux - Networking 2 04-20-2005 02:58 PM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
Unknown Host <Linuxmachinename> / Unable to ping by host name nishi_k_79 Linux - Networking 4 11-01-2003 01:24 PM
ping works, host works, ping host does not dublin212 Linux - Networking 3 03-31-2003 11:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration