[Samba] Custom dns_update_list file

L. van Belle belle at samba.org
Fri Feb 11 09:53:12 UTC 2022

This should not be a big problem with a systemd networking setup. 

Small example.. 

# This setup is for a Domain AD-DC server.
# IPV4 only.



# Disable ipv6 if needed.

# make use of systemd resolved and its setup, setup the 'search domain.'
# this MUST be set to your primary.DNSdomain.tld

# DNS resolvers (safe to mix IPv4 and IPv6)
# The comment here is more for member servers. 
# Max 3 DNS entries. ::1 or if you use a cacheing dns.
# if you use systemd-resolved stub (caching) dns, use (only)

# We resolve first through the primary IP of this AD-DC.
# The google dns is use as fallback, replace these if you have more DC's
# I suggest here 2 x DNS AD-DC, 1 x DNS internet.

# IPv4 gateway and primary address.

Now, setup a next file. 
Same as above, change the interface names. 

# This setup is for a Domain AD-DC server.
# IPV4 only.

Set the rest and the "per" interface dns is done. 
You need routes also, 

Add [Route] in the file, like this. 


Now, with that set. What will happen.. 

A program on the server will use /etc/resolv.conf 
Systemd-resolved fills /etc/resolv.conf 
With values from 

Anything that comes in on TCP protocl, will follow above. 

Hope this helps a bit. 
Ps, have a good read in systemd-networkd, it is very usefull.



> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> Arnaud FLORENT via samba
> Verzonden: donderdag 10 februari 2022 10:48
> Aan: samba at lists.samba.org
> Onderwerp: Re: [Samba] Custom dns_update_list file
> Le 09/02/2022 à 17:50, Victor Rodriguez via samba a écrit :
> > Hello,
> Hi
> >
> > I have the need to set specific IPs in DNS to allow clients to 
> > correctly communicate with Samba. I archieve this editing 
> > samba/private/dns_update_list and replacing the A record for the 
> > domain. This works until some package update replaces it with the 
> > default one.
> >
> > Is there any way to properly set a custom dns_update_list that does 
> > not get overwritten?
> on debian /ubuntu, you can try with diversion
> https://www.debian.org/doc/debian-policy/ap-pkg-diversions.html
> >
> > I can't use the interfaces directive in smb.conf as the 
> same interface 
> > has more than one IP.
> >
> > Thanks in advance
> >
> >
> -- 
> Arnaud FLORENT
> IRIS Technologies
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list