Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-27-2008, 09:46 PM   #1
LQ Newbie
Registered: Sep 2008
Posts: 4

Rep: Reputation: 0
Samba shares only visible using IP address but not host name

I have two computers, both running mepis 7.0 32 bit (basically debian etch). Both are fully updated. one is called "kitchen" and the other "dining_room" I had samba working fine, until I started messing around with NFS on "kitchen". Now "kitchen" isn't visible in Samba.

Using "kitchen", I can see and mount the shares from "dining_room", no problem. But the shares from "kitchen" are not visible on either computer.
In trying to debug this, I went to "kitchen" and using konqueror, I typed in "smb://kitchen/" and I get an error mounting share message. Now here is the interesting thing. If I try to mount shares using the IP address instead of the host name (e.g., smb:// instead of smb://kitchen/), it works fine. I also noticed in SMB4K (on "kitchen"), when I try to browse the shares, it is showing a different IP address than the one assigned to the machine. I know the machine is using, but in SMB4K, when trying to connect it indicates it is connecting to

I copied /etc/samba/samba.conf from the "dining_room" to "kitchen" and that didn't help. I checked /etc/hosts, /etc/hosts.allow, /etc/host.deny, and /etc/network/interfaces, to see if I had hard coded the IP address at some point when I was messing with NFS, but can't find anything out of sorts.

What configuration files do I need to check/edit, to correct this problem? The shares are visible using the IP address but not the host name, so samba is working. But there is something with the hostname and IP address I am overlooking. Any help would be appreciated.
Thanks Reply With Quote
Old 09-27-2008, 10:53 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you run nmap, what ports are open on the other machine.
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
631/tcp  open  ipp
631 is cups, but samba may use it. You do need 139 and 445 open. If you are using older technologies, such as you have Windows98 machines, they will use 137-139.

Also run "smbclient -L <hostname>" and see if the services are listed.

It seems to me that smb4k doesn't handle the [profile] service properly.

Try restarting smbd and nmbd on both machines.

If one of the machines is used as a server and always on, (such as a desktop for laptops on the network) you might try configuring the it as a wins server and putting it's IP address in the router's configuration, or each client's samba configuration.

Do your hosts use DHCP? Could the lease have changed reassigning IP addresses but samba and/or /etc/hosts and/or arp contains old IP address information?

Last edited by jschiwal; 09-27-2008 at 10:54 PM.
Old 09-27-2008, 11:12 PM   #3
LQ Newbie
Registered: Sep 2008
Posts: 4

Original Poster
Rep: Reputation: 0
First, thanks for the response.

I changed the IP address from DHCP to static on "kitchen", and some of the problems have sort of cleared up.

I am sure all the correct ports are open, because of two things: one, samba works when I use the IP address, and two, there is no difference even if the firewall is disabled.

when I do "smbclient -L kitchen" I get the response "timeout connecting to" I believe the is the openDNS server my box is pinging. However, if I do "smbclient -L", it works fine

etc/hosts is as follows: localhost kitchen

# The following lines are desirable for IPv6 capable hosts
# (added automatically by netbase upgrade)

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

While changing the IP address to static helped some, the printer share is not working correctly, unless I use the IP address instead of the host name.

I am firmly convinced this is not so much a SMB problem as much as it is an IP/network/hostname/DNS problem.
Old 09-27-2008, 11:54 PM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you changed to a static IP setup, and as you only have two hosts, edit your /etc/hosts file. Make sure that /etc/hosts is correct. If you had an old entry in /etc/hosts and you were assigned a different IP address, that could have caused your problem. It sounds like you don't have entries in your /etc/hosts file for the other computers on the network. This will enable you to use ssh or ping by name.

The samba-doc package (if you have it) supplies three books. Samba 3 by Example, and Samba 3 HOWTO & Reference Guide. The second one has a section on browsing. The troubleshooting section might help.

If you have the avahi service running, see if you can ping an IP address using "ping <hostname>.local".

Quote: localhost kitchen
Is this on the "kitchen" host?

You should be able to browse even if you don't have /etc/hosts entries (or a dns server). Vice-versa isn't necessarily true however.
I just tried an experiment. I commented out the /etc/hosts entry for "hpmedia" on my LAN. Then I ran "smbclient -L hpmedia". I was able to get the information. The argument after -L is the winbios hostname not the network hostname. If you use a command like "ping", then you do need an entry in /etc/hosts (or run dns or use <hostname>.local with avahi service running) to resolve the hostname.

Last edited by jschiwal; 09-27-2008 at 11:57 PM.
Old 09-28-2008, 01:42 AM   #5
Registered: Jul 2004
Location: Boston, MA
Distribution: Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
sure nmbd is running correctly? that's what establishes the hostnames on the windows network - the smb kioslave might rely on it to determine how to reach the other server. I know I use it on my home network - I have two linux boxes, a mac, and an old laptop running xp for compatibility - they can all see each other via samba, ftp, and sftp, and they all advertise as a windows network since that's the most limiting. I also use my /etc/hosts file pretty liberally with static ips.

hope that helps!
Old 09-28-2008, 08:59 AM   #6
LQ Newbie
Registered: Sep 2008
Posts: 4

Original Poster
Rep: Reputation: 0
The more I look at this and do research, the more I am convinced it is a nmbd issue. I tried to delete wins.dat and browse.dat, and have the system recreate them fresh. That had some positive impact, but not total resolution.

I'll probably try to uninstall and purge samba next (with apt) and reinstall it, to see if that helps clear out whatever config file is messing me up.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Help the newbie to samba make it work. Shares are visible, connecting can not find.. Mysticle31 Linux - Networking 5 01-10-2008 11:43 PM
Only Some Windows Shares visible from Linux cyent Linux - Networking 3 08-02-2006 12:31 AM
Samba XP shares: Only first 36 folder visible in Konqueror sugna Linux - Software 1 07-04-2005 07:59 AM
Change Visible ip on Host cli_man Linux - Networking 0 05-24-2004 10:55 AM
Lisa - found other machines but no shares visible Merlin-TC Linux - Networking 0 05-06-2003 12:18 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:26 PM.

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