Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (BLAG Linux and GNU)
tmp Disk
www Disk
home Disk
print$ Disk Printer Drivers
printer Printer printer
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.23c-1.fc5]
Server Comment
--------- -------
BEEFY Bethany's Compaq Presario
BRIXTON BLAG Linux and GNU
LAPDOG Mary's Dell Laptop
MAXY
TREY Compaq Presario
root@brixton=> mount -o username=pablo //trey/backups /mnt
mount error: could not find target server. TCP name trey/backups not found
No ip address specified and hostname not found
This operation works fine if I use an IP address instead of a hostname. My question is this: is there a way to find out the IP addresses associated with the servers on the network without walking over to each PC and typing "ipconfig" at the command line? Alternatively, is there a way to perform the above mount command by hostname instead of IP address?
I believe you can set samba up as a "WINS" server. Somebody correct me if I'm wrong, but I think all you have to do is edit your smb.conf with the following lines in the global section:
Code:
wins support = yes
name reslove order = wins lmhosts hosts bcast
All so if your hosts that have shares on them have static ip address's you can add an entry in the /etc/hosts file for them. However if your using DHCP this won't work.
To translate IP addresses to hostnames and vice-versa, you should look into using "nslookup", "dig" or "host". If the servers are defined in DNS, that is.
Also, on Linux, you're supposed to type "ifconfig", not "ipconfig" (Windows).
To translate IP addresses to hostnames and vice-versa, you should look into using "nslookup", "dig" or "host". If the servers are defined in DNS, that is.
Unfortunately, the servers in question are not in DNS, but rather are DHCP clients on a small home LAN.
Quote:
Originally Posted by timmeke
Also, on Linux, you're supposed to type "ifconfig", not "ipconfig" (Windows).
My desktop is a Linux box, but everything else on our LAN is a Windows PC, hence the use of ipconfig. Since the IP addresses are served up via DHCP, my goal is to reference hosts by name and not by IP if at all possible.
I believe you can set samba up as a "WINS" server. Somebody correct me if I'm wrong, but I think all you have to do is edit your smb.conf with the following lines in the global section:
Code:
wins support = yes
name reslove order = wins lmhosts hosts bcast
All so if your hosts that have shares on them have static ip address's you can add an entry in the /etc/hosts file for them. However if your using DHCP this won't work.
Let us know if this helps.
Thanks for the reply. I'll definitely try WINS authentication first, and will revert to static IP addresses as a last resort.
I believe you can set samba up as a "WINS" server. Somebody correct me if I'm wrong, but I think all you have to do is edit your smb.conf with the following lines in the global section:
Code:
wins support = yes
name reslove order = wins lmhosts hosts bcast
Slight typo, should read :
Code:
wins support = yes
name resolve order = wins lmhosts hosts bcast
Well, in that case, Wins indeed seems a good approach.
Alternatively, you could try to find out which leases are issued by the DHCP server (the DHCP server temporarily "leases" an IP address to the client). You may need to turn on the get-lease-hostname parameter in your dhcpd.conf, which is not recommended for large networks and may slow down DHCPD performance significantly.
See also http://www.howtoforge.com/dhcp_serve...x_debian_sarge
and the file /var/lib/dhcp3/dhcpd.leases
for instance.
The Wins approach is probably easier and safer, so I'd try that first.
I changed my smb.conf file to turn on WINS but still couldn't mount a network share by name:
Code:
root@brixton=> mount -o username=pablo //trey/backups /mnt
mount error: could not find target server. TCP name trey/backups not found
No ip address specified and hostname not found
I could, however, look up IP addresses on my network, which might prove a reasonable workaround:
Code:
pablo@brixton=> nmblookup trey
querying trey on 192.168.0.255
192.168.0.5 trey<00>
pablo@brixton=> nmblookup beefy
querying beefy on 192.168.0.255
192.168.0.3 beefy<00>
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.