I've set up an AD domain controller through Samba 4. I'm using Samba 4's internal DNS Server for handling the SRV queries.

However, due to project requirements, my clients need to have a DNSMASQ as their one and only DNS server.

Thus, my plan was to forward all queries which DNSMASQ can't handle to the Samba 4 server.

Let's assume the IP addresses of the servers are like this:

Server with DNSMASQ:

Server with SAMBA4:

To achieve that, I have added the following line to my DNSMASQ.conf:


After restarting DNSMASQ, it is not forwarding SRV quries to the SAMBA 4 DC. If I add the following line:

srv-host= _ldap._tcp.dc._msdcs.domain.example.com

the query gets forwarded, but the clients still can't join the domain. I get the following error message:

Host(A) or (AAAA) records that map the names of the domain controllers to their IP addresses are missing or contain incorrect addresses

Domain controllers registered in DNS are not connected to the network or are not running.

I assume there are still DNS problems, so these are my questions:

  • Is what I want to do possible at all?
  • Is there a way to just forward all SRV queries to another host with DNSMASQ?
  • Why is the server= line not working? Am I missing anything there?

I got it up and running.

Here's what my dnsmasq.conf looks like for a domain called domain.example.com, and a samba 4 domain controller with the IP of


The server on which dnsmasq is installed also needs to be able to resolve the FQDN of the samba 4 domain controller, so an entry into /etc/hosts is needed: dc1-samba.domain.example.com 

The /etc/hosts on the samba 4 server needs to be set up appropriately according to https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller

I took the information from here:


  • I am using dnsmasq in OPNsense as a forwarder between AD and in order to log traffic with Sensei. I'm using domain overrides for the AD domain for any device containing the domain name to be forwarded to the DCs for DNS resolution. It seems to work OK. – AveryFreeman Jun 6 '20 at 17:30

Is what I want to do possible at all?

Not if you want to have a Samba as an AD server. The only supported DNS servers for Samba are the internal DNS server or Bind. Your domain isn't going to work (e.g. PCs won't be able to be joined) if you try to use another DNS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.