Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba and DNS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
meka
Tux's lil' helper
Tux's lil' helper


Joined: 16 Dec 2003
Posts: 85
Location: Novi Sad / Vojvodina / Srbija

PostPosted: Tue May 13, 2008 1:47 pm    Post subject: Samba and DNS Reply with quote

I just suppose it's something about DNS, but it might be something else. Anyway, the problem is that I can mount the share if I give an IP address, but not by the hostname. Hostname mounts work only on the machines that are in the same subnet. This is my smb.conf:
Code:
[global]
        comment = Global section
        workgroup = DDOR
        netbios name = zra2
        server string = Gentoo/Linux station
        log file = /var/log/samba/log.%m
        max log size = 50
        log level = 3
        hosts allow = 127.0.0.1 192.168.0.0/16
        security = user
        encrypt passwords = yes
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 IPTOS_LOWDELAY
        dns proxy = yes
        wins support = yes
        message command = /etc/samba/linpopup.sh "%f" "%m" %s

[public]
        comment = Public Stuff
        path = /tmp
        public = yes
        writable = yes
        guest ok = yes
Back to top
View user's profile Send private message
jcat
Veteran
Veteran


Joined: 26 May 2006
Posts: 1337

PostPosted: Tue May 13, 2008 6:57 pm    Post subject: Reply with quote

I don't know much about your set-up, but you should either set-up DNS for all your hosts or at the very least deploy a standardised /etc/hosts file to all hosts (slightly modded as relevant for each individual host).

DNS is easier to manage in the long run.



Cheers,
jcat
Back to top
View user's profile Send private message
Inodoro_Pereyra
Advocate
Advocate


Joined: 03 Nov 2006
Posts: 2631
Location: En la otra punta del cable

PostPosted: Tue May 13, 2008 7:05 pm    Post subject: Reply with quote

That smb.conf belongs to wich host? If it belongs to the one wich is sharing and you can't connect, why are you subnetting 16 instead of 24? Wich are the other subnets that can't access the host? There is actually a DNS server in your network resolving hostnames? Have you tried:
Code:
echo "<IP_Number> <Hostname>" >> /etc/hosts

And then mount the share?

With a little bit more information may be somebody could help you, but it sounds like a DNS missconfiguration.

Regards.
_________________
Mi Blog.

Si no fuera por C, estaríamos escribiendo programas en BASI, PASAL y OBOL.
Back to top
View user's profile Send private message
meka
Tux's lil' helper
Tux's lil' helper


Joined: 16 Dec 2003
Posts: 85
Location: Novi Sad / Vojvodina / Srbija

PostPosted: Wed May 14, 2008 7:03 am    Post subject: Reply with quote

The machine that tries to mount stuff is the one the config is copied from. /16 is used because we have bunch of /24 subnets, so it was easier for me to put it this way. We do have DNS and it works ok (nslookup, ping and stuff). I've tried with entering IP in the /etc/hosts. I get same results when I try to smbclient -M <host> (it uses wins only?).
Back to top
View user's profile Send private message
pappy_mcfae
Watchman
Watchman


Joined: 27 Dec 2007
Posts: 5999
Location: Pomona, California.

PostPosted: Wed May 14, 2008 7:11 am    Post subject: Reply with quote

It's easier to use IP addresses. Using static IP addresses on each machine makes it easy to set up something like this snippet from my /etc/samba/smb.conf:
Code:
hosts allow = 192.168.0.100, 192.168.0.115, 192.168.0.120, 192.168.0.125, 192.168.0.130, 127.0.0.1
hosts deny = ALL

If you prefer to use hostnames, you must provide them in /etc/hosts thusly:
Code:
127.0.0.1 localhost pappy-lap.pappy.org pappy-lap
#
# Host names and IP addresses added by Pappy
192.168.0.100 pappy-lap
192.168.0.110 fred-v
192.168.0.115 gen_tosh
192.168.0.120 fred-ii
192.168.0.130 debby-anne-II

You have to make an entry for each machine to which you wish to connect.

Static IP addresses are your friends when it comes to samba. Nothing messes with samba more than DHCP.

Blessed be!
Pappy
_________________
This space left intentionally blank, except for these ASCII symbols.
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Wed May 14, 2008 5:24 pm    Post subject: Reply with quote

Quote:
Static IP addresses are your friends when it comes to samba. Nothing messes with samba more than DHCP.

This is rubbish, samba works fine with DHCP.

Quote:
Hostname mounts work only on the machines that are in the same subnet

The reason for this is that smbclient is using broadcasts to obtain the IP address from the netbios name of the server. This will not work outside of the subnet containing the samba server.
I see that you have
Code:
wins support = yes

This is good what you will need to do is specify the IP address of the samba server on each client in smb.conf and also a name resolve order
e.g.
Code:
win server = 192.168.0.5
name resolve order = lmhosts wins host bcast

That way the clients have a decent method for resolving the netbios name of the server.

I have a similar setup with several routed subnets all able to access a samba servers using the netbios name. The key is making sure your wins support is configured on the server and also the clients.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum