darudey Posted January 20, 2010 Report Share Posted January 20, 2010 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 Link to comment Share on other sites More sharing options...
{BBI}Nexus{BBI} Posted January 21, 2010 Report Share Posted January 21, 2010 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 More sharing options...
scarecrow Posted January 21, 2010 Report Share Posted January 21, 2010 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. Link to comment Share on other sites More sharing options...
darudey Posted January 21, 2010 Author Report Share Posted January 21, 2010 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 More sharing options...
SilverSurfer60 Posted January 21, 2010 Report Share Posted January 21, 2010 (edited) 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 January 21, 2010 by SilverSurfer60 Link to comment Share on other sites More sharing options...
ianw1974 Posted January 22, 2010 Report Share Posted January 22, 2010 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 More sharing options...
darudey Posted January 22, 2010 Author Report Share Posted January 22, 2010 I could setup static IP addresses, I don't have an 'always-on' machine to do DNS/DHCP/WINS etc. I'm still new to all this, but I found this on the web: http://lucasmanual.com/mywiki/SambaDomainController#Quick.3APingnetbiosnamesfromlinux Does anyone know if a solution like this would work? Link to comment Share on other sites More sharing options...
scarecrow Posted January 22, 2010 Report Share Posted January 22, 2010 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 More sharing options...
{BBI}Nexus{BBI} Posted January 22, 2010 Report Share Posted January 22, 2010 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 More sharing options...
Reiver_Fluffi Posted January 23, 2010 Report Share Posted January 23, 2010 Static Ip's managed by the router (which of course also acts as an intenet gateway) is by FAR the simplest and cleanest solution. Another vote for Scarecrow's advice. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now