Jump to content

Ping other Windows PCs


darudey
 Share

Recommended Posts

Add as root the ip address and the hostname to your /etc/hosts file.  A quick way to do this is to type as root:

echo '<ip address here> <hostname here>' >> /etc/hosts

 

If you can't do it that way you can do: Alt & F2 then type kdesu konqueror this will open your filemanager as root.  Navigate to your /etc folder, look for the hosts file, open it and insert the entry, then save the changes.

 

 

Link to comment
Share on other sites

Thanks to you both for your responses.

 

Unfortunately your answers doesn't quite satisfy what I was after.

Editing hosts file means the computers I want to ping must have a static IP.

 

It sounds as though this is more difficult than it should be - in Windows it just works.

 

If someone connected to my network and I know their hostname, I'd like to ping it or ssh to it using their hostname. Is this possible without finding out what the IP address is and editing the hosts file? - It must be possible.

Link to comment
Share on other sites

The solution you are after depends on the router and its dhcp server. You require the router to be able to supply the hostname/ip address to each computer on the same network. Some do some don't. It also depends on your gateway address. I assume you are using the router as the gateway? Other than the router maintaining the host/ip addresses you could set up one of you always on computers to act as a dhcp server. This is one area where Mandriva is a little more secure than windoze, in that one has to purposely open up the network to this sort of behavior. I hope there is something there that you can use.

Edited by SilverSurfer60
Link to comment
Share on other sites

Not only that, Windows by default is using NETBIOS and so when you use ping by the computer name you are using NETBIOS in this instance. You don't have a DNS Server and that is why you are unable to ping by name under Linux. Linux isn't recognising NETBIOS, and so why you have this problem. NETBIOS is a Windows thing - hence why you said it just works in Windows.

 

You can do one of two things. Configure your machine MAC addresses on your router so that it gives a specific IP to that MAC. The machine can remain as DHCP but will always get the same IP address from your router. Alternatively, just put a static IP on all your machines, and then edit /etc/hosts on the Linux machines so that it'll know where the machines are. Neither is a major change and takes minutes to do.

 

Or, if you want, set yourself up a DNS server and use this to resolve your machine names - but that'll take more work than using static IP.

Link to comment
Share on other sites

Static Ip's managed by the router (which of course also acts as an intenet gateway) is by FAR the simplest and cleanest solution.

You do not need dhcp/wins if you use static addresses, and regarding DNS, you can rely to the DNS server which is pinned on your router, or explicitly define a different one on any of your machines- no matter if they are Linux or Windoze.

Link to comment
Share on other sites

Static Ip's managed by the router (which of course also acts as an intenet gateway) is by FAR the simplest and cleanest solution.

You do not need dhcp/wins if you use static addresses, and regarding DNS, you can rely to the DNS server which is pinned on your router, or explicitly define a different one on any of your machines- no matter if they are Linux or Windoze.

I'm with scarecrow on this one.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...