Jump to content
darudey

Ping other Windows PCs

Recommended Posts

Hi all,

 

I'm running Mandriva One 2010.0, I have setup Samba to share folders and access other Windows' share folders.

 

But how do I ping the name of the PC and get it to resolve to the IP address?

 

e.g. ping DOWNSTAIRSMEDIAPC

Share this post


Link to post
Share on other sites

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.

 

 

Share this post


Link to post
Share on other sites

smbclient is enough, you don't need a full samba, nor any samba configuration.

To access the windoze shares, just open dolphin or konqueror and type in the address bar

smb://DOWNSTAIRSMEDIAPC

Before DOWNSTAIRSMEDIAPC you can add the domain name, if you have set any.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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...

×
×
  • Create New...