The Samba AD DNS Back Ends: Difference between revisions

From SambaWiki
m (/* minor update)
(49 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__TOC__
= Which DNS backend should I choose? =


= Introduction =
The DNS backend should be choosen, on the requirements of your network or existing DNS installations.


In an Active Directory (AD), DNS is a very important service. It is used for:
The internal DNS is a new implementation, that allows to quick and easy setup of the DNS backend, that is required for every AD installation. No further work is required to set it up. Currently it covers the important and required parts for AD.
* name resolution
* locating services, such as Kerberos and LDAP
* locating local domain controllers (DC) when using AD sites. For details, see [[Active_Directory_Sites|Active Directory Sites]].


{{Imbox
If you already having BIND running, plan complex DNS setups or you require special functions (zone transfers only from defined hosts, etc.), that are currently not supported by the internal DNS, BIND should be the preferred backend.
| type = note
| text = All clients and server in an AD must use a DNS server that is able to resolve the AD DNS zones.
}}


The choice for a DNS backend during provisioning/upgrading is not a one way street. If you find out, that your choice doesn't fit your requirements, you can flip over and [[Changing_the_DNS_backend|change the DNS backend]].








= Supported DNS Back Ends =


Samba supports the following DNS back ends:
= Internal DNS =


* [[Samba_Internal_DNS_Back_End|Samba Internal DNS Back End]]
The internal DNS server is built into Samba and uses AD as backend. Also it is the default DNS solution when you provisioning/upgrading an Samba AD controller.
:* Default when provisioning a new domain, joining an existing domain or migrating an NT4 domain to AD.
:* No additional software or DNS knowledge is required.
:* Use this back end for simple DNS setups. For a list of limitations, see [[Samba_Internal_DNS_Back_End#Limitations|Limitations]].


* [[BIND9_DLZ_DNS_Back_End|BIND9_DLZ DNS Back End]]
:* Requires BIND 9.8 or later installed and configured locally on the Samba Active Directory (AD) domain controller (DC). For additional information, see [[Setting_up_a_BIND_DNS_Server|Setting up a BIND DNS Server]].
:* Requires knowledge about the BIND DNS server and how to configure the service.
:* Use this back end for complex DNS scenarios, you can not configure in the internal DNS.




If you are unsure which DNS back end to select during the DC installation, start with the Samba internal DNS. You can change the back end at any time. For details, see [[Changing_the_DNS_Back_End_of_a_Samba_AD_DC|Changing the DNS Back End of a Samba AD DC]].
== Configuration ==


If you chose the internal server as DNS backend for your environment, there are two options that can be added to your smb.conf to control the behavior of DNS at this point:


{{Imbox
# Don't allow any updates | allow unsigned updates | only allow signed updates
| type = important
allow dns updates = False | nonsecure | signed
| text = Do not use the <code>BIND9_FLATFILE</code> DNS back end. It is not supported and will be formally deprecated when 4.11.0 is released and removed at 4.12.0.
}}
# If recursive queries = yes is set, the following is also needed
dns forwarder = <ip addr of external dns server>






== Limitations / Known issues ==


* The internal server is not a [[DNS/ToDo/caching_resolver|caching resolver]].
* The samba_dnsupdate command produces warnings when used with [[DNS/ToDo/signed_updates|signed updates]]. We're currenly investigating a fix for the warnings, but the updates actually succeed. Client systems like samba3 or Win7 work fine.
* Currently, recursive queries are not possible [[DNS/ToDo/recursive_queries_without_forwarder|without using a forwarder]]
* Negative replies do not come with an [[DNS/ToDo/add_authority_record|authority record]] (not required by RFC, but Windows seems to like that)
* [[DNS/ToDo/shared_key_tsig|Shared-key TSIG]] is not implemented
* [[DNS/ToDo/stub_zones|Stub zones]] are not implemented
* Zone axfr is not allowed from internal samba DNS


= Selecting the AD Forest Root Domain =


Before you provision your Active Directory (AD), you must select a DNS zone for your AD forest root domain. For details, see [[Active_Directory_Naming_FAQ|Active Directory Naming FAQ]].


{{Imbox
== Tests ==
| type = warning
| text = Samba does not support renaming the AD forest root domain.
}}


Best practices:
Run during make test
TDB_NO_FSYNC=1 make test TESTS=samba.tests.dns


* Use a domain name you own.
Run against external servers (Windows or BIND)
* Use a subdomain of your domain, such as <code>ad.example.com</code>.
SERVER_IP=<dns server ip> SERVER=<dns server name> REALM=<dns server domain name part> PYTHONPATH=`pwd`/bin/python ./source4/scripting/bin/subunitrun samba.tests.dns
* Do not use <code>.local</code> domains. They can cause problems with Mac OS X and Zeroconf.


For details, see [[Active_Directory_Naming_FAQ|Active Directory Naming FAQ]].








= BIND DLZ plug-in (for BIND 9.8 and 9.9) =


----
BIND can be setup to provide DNS resolving for zones managed in AD. They are accessable from BIND through the DLZ (dynamically loadable zones) plug-in. Please note that BIND server must run on the same machine Samba AD DC.
[[Category:Active Directory]]

[[Category:DNS]]


== Installation / Setup ==

See the [[DNS_Backend_BIND|Bind as DNS backend HowTo]] for a detailed instruction.





= Troubleshooting =

== Fix DNS dynamic updates with updated Samba versions ==

If you are running Samba 4.0.7 or later the bug https://bugzilla.samba.org/show_bug.cgi?id=9559 is already fixed.
But if your samba was updated from old releases and it´s not a fresh installation you may have problems with dynamic DNS updates with Windows XP sp3 and Windows 7.

To fix the problem you need to follow this steps:

* first of all, update your samba version if it is not the latest.

* you may want to do a kinit to avoid samba-tool asking you for a password

kinit administrator

Search for all the registry entries that contain the broken records using:

samba-tool dns query SERVER DOMAIN @ ALL

You´ll find registries like this:

Name=WORKSTATION, Records=0, Children=0

For every registry entry found like the one above you´ll need to issue the following commands

/usr/local/samba/bin/samba-tool dns add SERVER DOMAIN WORKSTATION A IP -k yes

/usr/local/samba/bin/samba-tool dns delete SERVER DOMAIN WORKSTATION A IP -k yes

On windows workstations you can run

ipconfig /registerdns

And dynamic updates should work ok.




== using ISC BIND backend with secured / signed dns updates ==

In the default configuration of Distrubuted ISC Bind in many Distributions you will find that the secured updates do not work with Samba 4. You will receive errors in /var/log/messages indicating update '<name of client>' denied i.e.
This is because the rpm/deb/pkg has been compiled with the 'disable-isc-spnego' flag.
In order to fix this you will need to recompile/rebuild the distribution rpm / deb / pkg .

=== common Bind9 Compile flags for BIND DLZ for bind 9.9 ===

Samba4 and up require for BIND DLZ at least --with-dlz-ldap , --with-dlz-filesystem=yes,

Common used configure flags for BIND9.8.6 and up :

<pre>
CONFIGURE_OPTIONS="\
...
--with-openssl \
--enable-threads \
--with-gssapi=yes \
--with-libtool \
--with-libxml2 \
--with-dlopen=yes \
--with-dlz-mysql \
--with-dlz-bdb \
--with-dlz-ldap \
--with-dlz-filesystem=yes \
--with-dlz-bdb=yes \
--enable-filter-aaaa \
--enable-rrl \
--with-ecdsa \
--enable-threads \
--with-idnlib='-L/usr/lib -R/usr/lib -lidn -lidn2' \
...
</pre>

The parameters for "-L" "-R" can differ from Distribution needs.

==== RHEL / CENTOS / FC + clones - ReBuild Distrubuted ISC Bind RPM ====

First make sure you have your RPM build environment setup and then install the source rpm for bind. The instructions that follow are .
For CENTOS 6.4 with 9.8.2-0.17.rc1.el6_4.6 being the latest version at the time of writing:

rpm -i http://vault.centos.org/6.4/updates/Source/SPackages/bind-9.8.2-0.17.rc1.el6_4.6.src.rpm

Then locate and edit SPEC file, if your rpm build directory is ~/rpmbuild then it will be ~/rpmbuild/SPECS/bind.spec

now locate and remove the line that reads

--disable-isc-spnego

On the example rpm provided it is line 361

now recompile your rpm

rpmbuild -bb ~/rpmbuild/SPECS/bind.spec

Once finished you should find the replacement rpms in the RPMS/{arch} path of your build root. Replace {arch} with the relevant architecture of your machine (e.g. x86_64 or i686). Install them over the top of your existing rpms and updates should all be working again. Remember if you update with yum it may replace your copy of bind so you will either want to exclude bind* in your yum configuration or use priorities and add these rpms to a local repository.


==== OpenSuSE using ISC BIND backend ====

In the default configuration of Bind in the OpenSuSE distribution you will find that the secured updates do not work with Samba 4.1 and up .
In order to fix this you will need to recompile the https://build.opensuse.org/package/show/openSUSE:Factory/bind .

[[User:Remsnet]] Published https://github.com/remsnet/OpenSuSE-Samba-DC/blob/master/bind-9.9.4-P1.spec

with Build Instructions at https://github.com/remsnet/OpenSuSE-Samba-DC/blob/master/Samba4-DC-DLZ.Readme

== RHEL/CENTOS/FC + clones - RPM Build New ISC Bind 9.9 / 9.10 ==

Benjamin Kraft publish since years his at [http://bkraft.fr/blog/bind_9_10_1_and_bind_9_9_6_and_bind_9_8_8/] Bind9 Security Fixes Page.
Cleanly Patching Bind9 been allmost an task for experts ...

[[User:Remsnet]] Published https://github.com/remsnet/CentOS-Bind-DLZ SPEC File for that SRPMS for that to Build an Clean and updated Bind9 with DLZ .

Revision as of 12:30, 28 August 2019

Introduction

In an Active Directory (AD), DNS is a very important service. It is used for:

  • name resolution
  • locating services, such as Kerberos and LDAP
  • locating local domain controllers (DC) when using AD sites. For details, see Active Directory Sites.



Supported DNS Back Ends

Samba supports the following DNS back ends:

  • Default when provisioning a new domain, joining an existing domain or migrating an NT4 domain to AD.
  • No additional software or DNS knowledge is required.
  • Use this back end for simple DNS setups. For a list of limitations, see Limitations.
  • Requires BIND 9.8 or later installed and configured locally on the Samba Active Directory (AD) domain controller (DC). For additional information, see Setting up a BIND DNS Server.
  • Requires knowledge about the BIND DNS server and how to configure the service.
  • Use this back end for complex DNS scenarios, you can not configure in the internal DNS.


If you are unsure which DNS back end to select during the DC installation, start with the Samba internal DNS. You can change the back end at any time. For details, see Changing the DNS Back End of a Samba AD DC.




Selecting the AD Forest Root Domain

Before you provision your Active Directory (AD), you must select a DNS zone for your AD forest root domain. For details, see Active Directory Naming FAQ.

Best practices:

  • Use a domain name you own.
  • Use a subdomain of your domain, such as ad.example.com.
  • Do not use .local domains. They can cause problems with Mac OS X and Zeroconf.

For details, see Active Directory Naming FAQ.