[Samba] Samba3 on multiple networks, how to make it hand out the correct IP?

Harry Jede walk2sun at arcor.de
Wed Sep 24 02:05:03 MDT 2014

On 09:15:11 wrote Bram Matthys:
> Hi,
> My Samba 4.1.x server is connected to two networks, one in the
> 192.168.* range (wired) and one in the 10.* range (wifi). The
> clients on either network normally cannot reach each other.
> I noticed Samba hands out (eg: for dcname.company.net) it's IP's from
> both ranges to clients on both sides. So the 192.168.* clients get
> two A records: &
> I noticed that, because of this current behavior, domain logins
> (well, time between login & until the user sees a desktop) have an
> extra delay of more than 60 seconds because the client tries to
> connect to the wrong IP. Eventually it works, but the penalty is
> huge.
> Given that Samba knows which network the client is on I would have
> expected it to actually be a little bit smarter with regards to
> that.
> Anyway, I'd like to see this changed so that any clients on 192.168.*
> only get the address, and the clients on 10.* only get
> How can I do this?
I dont know how to do this on the dns server, but you may do it on the 

i.e. modifiy your dns resolver settings

a working setup on my home networks:

## client PC
# cat /etc/resolv.conf 
domain home.lan
search home.lan ad.schule.lan

Important is the sortlist statement. It points to clients local network.

The Samba/DNS Server has 4 adresses. The nameserver is a 
slave bind server for my ad domain.

## client PC
# host dc0
dc0.ad.schule.lan has address
dc0.ad.schule.lan has address
dc0.ad.schule.lan has address
dc0.ad.schule.lan has address

# ping -c1 dc0
PING dc0.ad.schule.lan ( 56(84) bytes of data.
64 bytes from icmp_req=1 ttl=64 time=0.491 ms

Network clients like ping always uses the local name server address.

> Thanks,
> Bram.


	Harry Jede

More information about the samba mailing list