to ping

I have two machines wtu and mac

/etc/hosts file of first machine is  ie wtu is


 Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               wtu.localdomain wtu localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
~                                                                              
~                                              

the second machine mac is

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localdomain
192.168.1.12 mac.localdomain mac







=========
how can I make the machine ping each other...
tomvvAsked:
Who is Participating?
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You can't, unless wtu has an IP of 192.168.1.x (and you know it), or you know the IPv6 address of both machines. IPv6 addresses will be derived from the MAC address, together with some fixed network prefix. If your machines register with a (D)DNS server, using the name with ping should be possible.
127.0.0.1 is always the local machine, as is ::1, so this entries are useless for communicating.
0
 
Dave BaldwinFixer of ProblemsCommented:
The 'hosts' file doesn't normally have anything to do with ping.  On Linux, you should be able to open 'Network Tools' and ping the other machine.  You have to know the IP address or the hostname of the other machine.  These are not normally stored in the 'hosts' file.  I don't remember if one of the 'Network Tools' will tell you what your IP address is.  I have programs on all my different machines that tell what my IP addresses are.
0
 
tomvvAuthor Commented:
I know in linux the /etc/hosts entries to be added like this in the /etc/hosts file in order to ping..

# that require network functionality will fail.
127.0.0.1 localdomain
192.168.1.16 wtu.localdomain wtu
192.168.1.12 mac.localdomain mac


but like this we want to add a  windows machine to be pinged like this
how will be the entries to be put like this only or in a different way in the same file..
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
Dave BaldwinFixer of ProblemsCommented:
With 'ping' either on the command line or in Network Tools, you can ping by IP address, you do not Need the entries in /etc/hosts.  You can add the IP and Windows host name so you can also ping by name just like you show above.  On my workgroup LAN, all I had to add was the single word that is shown as the 'full computer name' in the System properties in the Control Panel.  I don't know if you need more in an AD domain.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
As said above, the hosts file is optional and for convenience only - if no internal DNS service is configured, or the domain suffixes for DNS are not compatible / set / whatever.
AD requires a DNS server, so the only issue with that is you need to configure your own DNS domain suffix and DNS server setting correctly on all AD non-members.
   ping 192.168.1.16
   ping 192.168.1.12
should work without any further setup, the same applies to the new IP you want to ping. Only if you want to use the names, there is more to do as mentioned above.
0
 
crazedsanityCommented:
In other words, each machine has to have their hosts file with the hostname & IP of the other in order to do host-based pings.  You can instead use IP's without any DNS or "hosts" file editing.
0
 
tomvvAuthor Commented:
In simple my question is this..

how can we ping one linux machine and one windows each other..

in linux there is /etc/hosts I know ..

in windows side what we do ,,
0
 
Dave BaldwinFixer of ProblemsCommented:
Your question has been answered several ways.  What do you not understand?

You can 'ping' by IP address without making any changes to any files.  The 'hosts' files can be changed if you want to ping by 'hostname' instead of IP address.
0
 
crazedsanityCommented:
DaveBaldwin is basically right: if you just want to use IP addresses (which is the way that is most likely to work first), you can do that without doing anything more than connecting them to networks that can talk to each other.

If you want to ping based on a name, that's a bit different.  

Using hostnames generally involves DNS or "winbind"/netbios: that involves making sure that your Linux machine has Samba setup properly, with the correct configuration so it will announce itself (and resolve other netbios names on the network).  This is how hostname pinging (e.g. "ping windowslaptop") seems to "just work"... usually.

Without DNS and winbind/Samba, you can use the hosts file.  In Linux, it's located in "/etc/hosts".  In windows, it's in "%SystemRoot%\System32\drivers\etc\hosts"... a full list is available at Wikipedia (http://en.wikipedia.org/wiki/Hosts_%28file%29).  The problem with this is that you'll have to enter each hostname on every machine that you want to ping with... and if the IP's are dynamic, you may find at some point that you're not pinging anything, or the wrong machine altogether.

You can setup a DNS server that handles resolution of a local domain (e.g. "company.local", so the full hostname for a host called "mybox" would be "mylinux.company.local").  You'll have to make sure that the DHCP server that hands out IP addresses also tells clients to use that server for DNS.

Another (seemingly rarer optiion): If your router supports dynamic local DNS (probably not the right term, but it's all I can come up with right now), then the machines themselves can potentially get local DNS names and automatically be able to ping each other.
0
 
tomvvAuthor Commented:
problem solved.,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.