LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-22-2006, 03:52 PM   #1
poblano
Member
 
Registered: May 2003
Location: Cape Cod, MA
Distribution: Debian Stable, CentOS, Ubuntu, etc.
Posts: 63

Rep: Reputation: 16
Question IP address lookup of samba clients


I am running Samba on my Linux desktop to back up data to a network share. Unfortunately I can't seem to mount by hostname - only by IP address:

root@brixton=> smbclient -L localhost -N
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.23c-1.fc5]

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

Workgroup Master
--------- -------
WORKGROUP BRIXTON

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?

Thanks in advance...
 
Old 10-23-2006, 10:09 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
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.
 
Old 10-23-2006, 10:15 AM   #3
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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).

Last edited by timmeke; 10-23-2006 at 10:17 AM.
 
Old 10-23-2006, 10:40 AM   #4
poblano
Member
 
Registered: May 2003
Location: Cape Cod, MA
Distribution: Debian Stable, CentOS, Ubuntu, etc.
Posts: 63

Original Poster
Rep: Reputation: 16
IP address of samba clients

Quote:
Originally Posted by timmeke
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.
 
Old 10-23-2006, 10:45 AM   #5
poblano
Member
 
Registered: May 2003
Location: Cape Cod, MA
Distribution: Debian Stable, CentOS, Ubuntu, etc.
Posts: 63

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by fordeck
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.
 
Old 10-23-2006, 11:40 AM   #6
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
Quote:
Originally Posted by fordeck
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
 
Old 10-24-2006, 01:52 AM   #7
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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.
 
Old 10-24-2006, 06:29 PM   #8
poblano
Member
 
Registered: May 2003
Location: Cape Cod, MA
Distribution: Debian Stable, CentOS, Ubuntu, etc.
Posts: 63

Original Poster
Rep: Reputation: 16
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>
Thanks to everyone for the helpful replies.
 
Old 10-25-2006, 08:21 AM   #9
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Check your windows clients to make sure the "WINS" server is assigned in your TCP/IP properties.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding hostname and IP address to DNS for sendmail ip lookup Simon_T Linux - Networking 1 06-04-2006 07:30 AM
problem with sendmail, IP address lookup failed mcd Linux - Networking 6 03-14-2005 08:14 AM
Can't lookup internet address for localhost.localadmin? joshnerl Linux - Newbie 8 04-13-2004 07:30 AM
could not lookup internet address for localhost.localdomain verstapp Linux - Networking 1 03-15-2004 03:44 PM
ERROR: Failed to lookup IP address for (domain name) aluminum Linux - Newbie 7 11-11-2003 08:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration