http:///https:///api.php?action=feedcontributions&user=Milan.Kerslager&feedformat=atomSambaWiki - User contributions [en]2024-03-29T15:22:13ZUser contributionsMediaWiki 1.39.5https://wiki.samba.org/index.php?title=BIND9_DLZ_DNS_Back_End&diff=9161BIND9 DLZ DNS Back End2014-08-14T18:12:26Z<p>Milan.Kerslager: /* Bind 9.8 / 9.9 */ command is "named-checkconf" (without "run ")</p>
<hr />
<div>= Introduction =<br />
<br />
This HowTo describes how to compile and configure a basic Bind installation, that can be used as Samba DC DNS backend.<br />
<br />
Bind as DNS backend is recommended, if you plan setup a complexer DNS setup, than the Samba 4 internal DNS currently made possible.<br />
<br />
<br />
<br />
<br />
= Setting up a basic Bind installation =<br />
<br />
Skip this section if you already having an existing Bind installation; that can be used as a Samba AD backend.<br />
<br />
<br />
<br />
== Installing Bind ==<br />
<br />
Bind as backend for your Samba Active Directory Domain Controller is currently supported in version 9.8 and 9.9 only. Users of bind 9.7 are strongly encouraged to upgrade! If this is not possible, refer to the section [[#Bind_9.7_2|DNS dynamic updates via Kerberos for Bind 9.7]] for instructions on configuring Bind 9.7.<br />
<br />
If you install Bind from the repositories of your distribution, you can skip the following two steps. But make sure that your vendor compiled Bind with the '--with-gssapi' and '--with-dlopen' options (see below) before using it as Samba AD DNS backend.<br />
<br />
<br />
=== Downloading ===<br />
<br />
Download your desired and Samba 4 supported version from [https://www.isc.org/software/bind https://www.isc.org/software/bind].<br />
<br />
<br />
=== Compiling Bind ===<br />
<br />
To use Bind 9.8.1 or later as Samba AD backend, at least the following two configure options are required:<br />
<br />
# ./configure --with-gssapi=/usr/include/gssapi --with-dlopen=yes<br />
<br />
Please check if there are other options you require for your environment. For building Bind 9.8.0, you must use '--with-dlz-dlopen=yes' instead of '--with-dlopen=yes'.<br />
<br />
To build and install:<br />
<br />
# make<br />
# make install<br />
<br />
<br />
<br />
== Configuration ==<br />
<br />
=== Setting up a basic named.conf ===<br />
<br />
The following example is a basic 'named.conf' for a pure minimal Bind installation without any Samba AD parts. We will add the Samba required parameters later.<br />
<br />
# Global options<br />
options {<br />
<br />
auth-nxdomain yes;<br />
<br />
directory "/var/named";<br />
<br />
forwarders { 8.8.8.8; 8.8.4.4; };<br />
<br />
allow-transfer { none; };<br />
notify no;<br />
<br />
empty-zones-enable no;<br />
<br />
allow-query {<br />
10.1.1.0/24;<br />
...other networks you want to allow to query your DNS...;<br />
};<br />
<br />
allow-recursion {<br />
10.1.1.0/24;<br />
...other networks you want to allow to do recursive queries...;<br />
};<br />
<br />
};<br />
<br />
<br />
# Root servers (required zone for recursive queries)<br />
zone "." {<br />
type hint;<br />
file "named.root";<br />
};<br />
<br />
<br />
# Required localhost forward-/reverse zones<br />
zone "localhost" {<br />
type master;<br />
file "master/localhost.zone";<br />
};<br />
<br />
zone "0.0.127.in-addr.arpa" {<br />
type master;<br />
file "master/0.0.127.zone";<br />
};<br />
<br />
We chose '/var/named' as directory in 'named.conf' to be the place where our zonefiles, etc. reside. If you want to place them on a different location, please regard this in all further instructions.<br />
<br />
For more details on the parameters used in the sample 'named.conf', see 'man 5 named.conf'.<br />
<br />
<br />
<br />
=== Adding a user and group for Bind ===<br />
<br />
If you don't want to run bind as root (and I'm sure you don't want that!), we add an account and group (adapt the UID/GID if required):<br />
<br />
# groupadd -g 25 named<br />
# useradd -g named -u 25 -d /var/named -M -s /sbin/nologin named<br />
<br />
<br />
<br />
=== Getting the root name server list ===<br />
<br />
Download the root name server list from InterNIC:<br />
<br />
# wget -q -O /var/named/named.root http://www.internic.net/zones/named.root<br />
# chown named:named /var/named/named.root<br />
<br />
To have always the current file, you can add a cronjob to automatically download.<br />
<br />
<br />
<br />
=== Creating the localhost zone file ===<br />
<br />
Create a forward zone file ('/var/named/master/localhost.zone') for your 'localhost' zone:<br />
<br />
$TTL 3D<br />
<br />
$ORIGIN localhost.<br />
<br />
@ 1D IN SOA @ root (<br />
2013050101 ; serial<br />
8H ; refresh<br />
2H ; retry<br />
4W ; expiry<br />
1D ; minimum<br />
)<br />
<br />
@ IN NS @<br />
IN A 127.0.0.1<br />
<br />
<br />
<br />
=== Creating the 0.0.127.in-addr.arpa zone file ===<br />
<br />
Create a reverse zone file ('/var/named/master/0.0.127.zone') for your '0.0.127.in-addr.arpa' zone:<br />
<br />
$TTL 3D<br />
<br />
@ IN SOA localhost. root.localhost. (<br />
2013050101 ; Serial<br />
8H ; Refresh<br />
2H ; Retry<br />
4W ; Expire<br />
1D ; Minimum TTL<br />
)<br />
<br />
IN NS localhost.<br />
<br />
1 IN PTR localhost.<br />
<br />
<br />
<br />
=== Set permissions on the zone files ===<br />
<br />
# chown named:named /var/named/master/*.zone<br />
# chmod 640 /var/named/master/*.zone<br />
<br />
<br />
<br />
<br />
<br />
== Starting Bind ==<br />
<br />
# named -u named<br />
<br />
If the configuration is valid, you should see no errors on the console and in the system logfile.<br />
<br />
To have Bind automatically started at boot time, it's recommended, to create a init.d script or start it by systemd.<br />
<br />
<br />
<br />
<br />
<br />
== Testing your zone ==<br />
<br />
Now we try to lookup our zone entries. We tell the 'host' command, to use the resolver on 127.0.0.1, so that we don't query an foreign DNS server, that is maybe also configured in '/etc/resolv.conf'.<br />
<br />
First check the forward lookup for 'localhost':<br />
# host localhost. 127.0.0.1<br />
Using domain server:<br />
Name: 127.0.0.1<br />
Address: 127.0.0.1#53<br />
Aliases: <br />
<br />
localhost has address 127.0.0.1<br />
<br />
And then the reverse lookup for '127.0.0.1':<br />
# host 127.0.0.1 127.0.0.1<br />
Using domain server:<br />
Name: 127.0.0.1<br />
Address: 127.0.0.1#53<br />
Aliases: <br />
<br />
1.0.0.127.in-addr.arpa domain name pointer localhost.<br />
<br />
<br />
<br />
<br />
<br />
= Configuring Bind as Samba Active Directory backend =<br />
<br />
* Note: BIND must be installed on the same machine as Samba AD DC. Since BIND DLZ module accesses AD database directly, BIND for AD zones must be on the same machine.<br />
<br />
<br />
<br />
== Bind 9.8 / 9.9 ==<br />
<br />
During provisioning/upgrading, a file ('/usr/local/samba/private/named.conf') was created, that must be included in your Bind named.conf:<br />
<br />
include "/usr/local/samba/private/named.conf";<br />
<br />
If you had provisioned with the internal DNS, there are some few steps required first to [[Changing_the_DNS_backend#Changing_from_Samba_Internal_DNS_to_BIND_DLZ|switch to Bind]].<br />
<br />
Depending on the Bind version you are running, you should edit '/usr/local/samba/private/named.conf' and enable the right version of the DLZ module.<br />
<br />
Restart Bind to have the included file being used. Check the logfiles for errors and problems. If available, you can run <code>named-checkconf</code> to help you fix any problems with your Bind configuration.<br />
<br />
== Bind 9.7==<br />
<br />
Users of bind 9.7 are strongly encouraged to upgrade! If this is not possible, refer to the section [[#Bind_9.7_2|DNS dynamic updates via Kerberos for Bind 9.7]] for instructions on configuring Bind 9.7.<br />
<br />
<br />
<br />
== DNS dynamic updates via Kerberos (optional, but recommended) ==<br />
<br />
Samba has the capability to automatically update the Bind zone files via Kerberos.<br />
<br />
To setup dynamic DNS updates you need to have a recent version of Bind installed. It is highly recommended that you run at least version 9.8.0, as that version includes a set of patches from the Samba Team to make dynamic DNS updates much more robust and easier to configure. Please use 9.8 or 9.9 if possible!<br />
<br />
To find out what version of Bind you are running, use<br />
<br />
# named -V<br />
<br />
If your operating system does not have Bind 9.8 or 9.9, please consider getting it from a package provided by a 3rd party (for example, on Ubuntu there is a ppa available with the newer versions of bind) or [[#Installing_Bind|compile it by yourself]].<br />
<br />
<br />
<br />
=== Bind 9.8 / 9.9 ===<br />
<br />
A DNS keytab file was automatically created during provisioning/updating. Add the following' tkey-gssapi-keytab' option to the 'options' section of your named.conf:<br />
<br />
options {<br />
[...]<br />
tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";<br />
[...]<br />
};<br />
<br />
<br />
<br />
=== Bind 9.7 ===<br />
<br />
If you have Bind 9.7.x (specifically 9.7.2 or later), then first determine if you can at all possibly run 9.8 or 9.9. You will have far fewer problems! Otherwise, follow these instructions:<br />
<br />
The Samba provision will have created a custom '/usr/local/samba/private/named.conf.update' configuration file. You need to include this file in your 'named.conf' to allow Samba/Kerberos DNS updates to automatically take place.<br />
<br />
include "/usr/local/samba/private/named.conf.update";<br />
<br />
Be advised that if you include this file in Bind versions that don't support it, Bind will fail to start!<br />
<br />
You additionally need to set two environment variables when using 9.7:<br />
<br />
KEYTAB_FILE="/usr/local/samba/private/dns.keytab"<br />
KRB5_KTNAME="/usr/local/samba/private/dns.keytab"<br />
export KEYTAB_FILE<br />
export KRB5_KTNAME<br />
<br />
These should be put in your settings file for Bind. On Debian based systems (including Ubuntu) this is in '/etc/default/bind9'. On RedHat and SuSE derived systems it is in '/etc/sysconfig/named'. Please refer to your distribution documentation for the correct location to set these environment variables. Strictly speaking, you only either need KEYTAB_FILE or KRB5_KTNAME, but which you need depends on your distribution, so it's easier to just set both.<br />
<br />
The 'dns.keytab' must be readable by the bind server process:<br />
<br />
# chown named:named /usr/local/samba/private/dns.keytab<br />
<br />
Normally, the provision/update should have setup these permissions for you automatically.<br />
<br />
Finally, you need to add the following to the options section of your named.conf:<br />
<br />
options {<br />
[...]<br />
tkey-gssapi-credential "DNS/server.samdom.example.com";<br />
tkey-domain "SAMDOM.EXAMPLE.COM";<br />
[...]<br />
};<br />
<br />
The last part of the credential in the first line must match the dns name of the server, you have set up.<br />
<br />
<br />
<br />
=== Testing/Debugging dynamic DNS updates ===<br />
<br />
The way the automatic DNS update in Samba works, is that the provision will create a file '/usr/local/samba/private/dns_update_list', which contains a list of DNS entries that Samba will try to dynamically update at startup and every 10 minutes thereafter using the 'samba_dnsupdate' utility. Updates will only happen if the DNS entries do not already exist. Remember that you need the 'nsupdate' utility from Bind the distribution for all these to work.<br />
<br />
If you want to test or debug this process, then please run as root:<br />
<br />
# /usr/local/samba/sbin/samba_dnsupdate --verbose --all-names<br />
<br />
The command line options specified will force an update of all records in the 'dns_update_list', as well as output detailed information on what is being done.<br />
<br />
= Interaction with AppArmor or SELinux =<br />
<br />
If you are getting an error from samba_dnsupdate and nsupdate '''return dns_tkey_negotiategss: TKEY is unacceptable''' try the following:<br />
<br />
If you are using AppArmor or SELinux, you have to ensure that the Bind process has read access to the following files: <br />
* /usr/local/samba/private/dns.keytab<br />
* /usr/local/samba/private/named.conf<br />
as well read-write access to the<br />
* /usr/local/samba/private/dns/<br />
directory and it's own zone file(s).<br />
<br />
The Samba provision tries to setup the permissions correctly for these files, but you may find you need to make changes in your AppArmor or SELinux configuration if you are running either of those. If you are using AppArmor, then the 'aa-logprof' command may help you add any missing permissions you need to add after you start Samba and Bind for the first time after configuring them.<br />
<br />
Permissions, SELinux Labeling and Policy<br />
<br />
These instructions are intended for RHEL6, but may serve as a guide for other distributions/versions.<br />
<br />
There is still more work to be done in regards of creating a Samba 4 specific SELinux policy but for now you should be able to have everything working without disabling SELinux.<br />
<br />
For all the commands below, make sure you have set the following environment variable:<br />
MYREALM="samdom.example.com"<br />
<br />
Set Permissions (SELinux):<br />
<br />
chown named:named /usr/local/samba/private/dns<br />
chgrp named /usr/local/samba/private/dns.keytab<br />
chmod g+r /usr/local/samba/private/dns.keytab<br />
chmod 775 /usr/local/samba/private/dns<br />
<br />
Label files (SELinux):<br />
<br />
chcon -t named_conf_t /usr/local/samba/private/dns.keytab<br />
chcon -t named_conf_t /usr/local/samba/private/named.conf.update<br />
chcon -t named_var_run_t /usr/local/samba/private/dns<br />
chcon -t named_var_run_t /usr/local/samba/private/dns/${MYREALM}.zone<br />
<br />
Set Label Persistence (SELinux):<br />
<br />
semanage fcontext -a -t named_conf_t /usr/local/samba/private/dns.keytab<br />
semanage fcontext -a -t named_conf_t /usr/local/samba/private/named.conf<br />
semanage fcontext -a -t named_conf_t /usr/local/samba/private/named.conf.update<br />
semanage fcontext -a -t named_var_run_t /usr/local/samba/private/dns<br />
semanage fcontext -a -t named_var_run_t /usr/local/samba/private/dns/${MYREALM}.zone<br />
semanage fcontext -a -t named_var_run_t /usr/local/samba/private/dns/${MYREALM}.zone.jnl<br />
<br />
AppArmor Configuration :<br />
<br />
Add the following to the end of /etc/apparmor.d/local/usr.sbin.named (create it if it doesn't already exist).<br />
<br />
# Samba4 DLZ and Active Directory Zones (default source installation)<br />
/usr/local/samba/lib/** rm,<br />
/usr/local/samba/private/dns.keytab r,<br />
/usr/local/samba/private/named.conf r,<br />
/usr/local/samba/private/dns/** rwk,<br />
<br />
= Debugging Bind as Samba AD backend =<br />
<br />
For enabling debugging on the Bind DLZ module, change the following line in '/usr/local/samba/private/named.conf' from<br />
<br />
database "dlopen .../bin/modules/bind9/dlz_bind9.so";<br />
<br />
to<br />
<br />
database "dlopen .../bin/modules/bind9/dlz_bind9.so -d 3";<br />
<br />
If you are running Bind 9.9, then add the '-d 3' to the corresponding line.<br />
<br />
Stop Bind and run the service manually to capture logs:<br />
<br />
# /usr/sbin/named -u named -f -g 2>&1 | tee named.log<br />
<br />
<br />
<br />
<br />
<br />
= Known issues and ways to fix/workaround =<br />
<br />
== Chroot Bind ==<br />
<br />
If you use Bind as Backend for your Samba AD, it must not run chroot, because it must be able to live access files and databases from your Samba installation.<br />
<br />
To disable chroot for Bind, see the documentation for your distribution. In some, you can set <br />
NAMED_RUN_CHROOTED="no"<br />
in "/etc/sysconfig/named" and restart the service.<br />
<br />
<br />
<br />
== Debian: Bind is listening on wrong IP address ==<br />
<br />
On Debian systems, the AD zone auto-generation might detect and use '127.0.1.1' as the domain controller's IP address. This will cause problems when trying to connect to the server from client machines. To fix this, you will need to adjust '/usr/local/samba/private/named.conf' by changing '127.0.1.1' to reflect the actual IP address of the server you're setting up.<br />
<br />
<br />
<br />
== Debian Sid: Named does not start ==<br />
<br />
On Debian Sid (Bind 9 package), '/etc/bind/named.conf.options' is missing and this will cause the named daemon to fail to start. To fix this either create an empty file, or comment out corresponding line in '/etc/bind/named.conf'. See your syslog messages for more information. <br />
<br />
<br />
<br />
== New added DNS entries are not resolvable ==<br />
<br />
If you have problems with resolving new added DNS entries using the BIND9 DLZ interface, you maybe want to check the following:<br />
<br />
Files in 'samba/private/dns/sam.ldb.d/' are hardlinks to 'samba/private/sam.ldb.d/'.<br />
Maybe you've copied/moved it across filesystems and the hardlinking got lost<br />
and you're now running with two different copies of the databases at the moment<br />
(You can test this by adding a new DNS entry, e. g. by 'samba-tool'. If you can't<br />
resolve it, check if the inodes differ).<br />
<br />
If you 'ls -i' on the two folders, you should see, that the following files<br />
have the same inodes (what indicates, that they are hard-linked):<br />
<br />
# ls -lai .../samba/private/sam.ldb.d/<br />
17344368 -rw-rw---- 2 root named 4251648 11. Nov 18:27 DC%3DDOMAINDNSZONES,DC%3DSAMBA,DC%3DEXAMPLE,DC%3DCOM.ldb<br />
17344370 -rw-rw---- 2 root named 4251648 11. Nov 18:27 DC%3DFORESTDNSZONES,DC%3DSAMBA,DC%3DEXAMPLE,DC%3DCOM.ldb<br />
17344372 -rw-rw---- 2 root named 421888 11. Nov 17:53 metadata.tdb<br />
<br />
# ls -lai .../samba/private/dns/sam.ldb.d/<br />
17344368 -rw-rw---- 2 root named 4251648 11. Nov 18:27 DC%3DDOMAINDNSZONES,DC%3DSAMBA,DC%3DEXAMPLE,DC%3DCOM.ldb<br />
17344370 -rw-rw---- 2 root named 4251648 11. Nov 18:27 DC%3DFORESTDNSZONES,DC%3DSAMBA,DC%3DEXAMPLE,DC%3DCOM.ldb<br />
17344372 -rw-rw---- 2 root named 421888 11. Nov 17:53 metadata.tdb<br />
<br />
If the files in the two folders have different inode numbers, then they<br />
aren't hard-links. To fix this, run<br />
<br />
# samba_upgradedns --dns-backend=BIND9_DLZ<br />
<br />
This will recreate the DNS files with correct hard links and permissions.<br />
<br />
Then restart Bind.<br />
<br />
<br />
<br />
== DDNS updates not working ==<br />
<br />
Check that the file '/etc/krb5.conf' is readable by Bind.</div>Milan.Kerslagerhttps://wiki.samba.org/index.php?title=Required_Settings_for_Samba_NT4_Domains&diff=7966Required Settings for Samba NT4 Domains2013-09-08T17:10:11Z<p>Milan.Kerslager: Try to make Google friendly (ie. users are searching for one of Windows 7, Windows 8 or so)</p>
<hr />
<div>'''Samba usually doesn't require any changes on your Windows OS.''' So please read very carefully on the sections below why and when you should do them! If your situation or problem isn't mentioned here, then it's highly recommented to <u>NOT</u> do any registry changes!'''<br />
<br />
'''This does not apply if Windows is joining to AD (Active Directory) style domain (ie. Samba 4).'''<br />
<br />
== Joining Windows to classic DC ==<br />
Joining '''Windows 7''', '''Windows Server 2008''', '''Windows Server 2008 R2''', '''Windows Server 2012''' or '''Windows 8''' to the ''classical windows domain'' (aka NT-4 style domain) requires registry change in those systems. This is the only situation, when domain controller is Samba 3 (ie. before Samba 4) which means Samba is in role PDC or BDC (Primary Domain Controller, Backup Domain Controller). Samba 3 is not able to create AD (Active Directory) while Samba 4 creates AD by default (which means to provide Kerberos/LDAP services).<br />
<br />
If you try to join any of the mentioned OS you'll encounter an error:<br />
<br />
The following error occurred attempting to join the domain „.....“:<br />
<br />
The specified domain either does not exist or could not be contacted.<br />
<br />
The following registry change work with any Samba version that isn't already [[Samba_Release_Planning|discontinued]]:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]<br />
<br />
"DomainCompatibilityMode"=dword:00000001<br />
"DNSNameResolutionRequired"=dword:00000000<br />
<br />
Do the changes manually in <tt>regedit.exe</tt> or save the above in a plain text file with Notepad/Editor (not Word/Wordpad/OpenOffice/LibreOffice/...!) and name it <tt>sambafix.reg</tt>. Make sure, that the file has the ending <tt>.reg</tt>. Then you can import it directly to your registry by double-clicking, if you have the sufficient permissions.<br />
<br />
After the next reboot you can join the machine to your domain.<br />
<br />
=== Possible problem with joining ===<br />
Sometimes you may still encounter an error when joining classical domain:<br />
<br />
Changing the Primary Domain DNS name of this computer to "" failed. The name will remain ".....".<br />
The error was:<br />
<br />
The specified domain either does not exist or could not be contacted<br />
<br />
But this error can safely be ignored or, if you run Windows 7, silenced by a hotfix, that was published by Microsoft: [http://support.microsoft.com/kb/2171571 KB2171571: You incorrectly receive an error message when you join a computer that is running Windows 7 or Windows Server 2008 R2 to a Samba 3-based domain].<br />
<br />
== Windows 8 and classic domain (NT-4 style) with a dot in its name ==<br />
There is a problem with Windows 8, where Microsoft raises new domain name policy. When a domain contain a dot (".") in its name (ie. ''example.com''), Windows 8 treat this name as a Active Directory name and is trying to contact Kerberos/LDAP server even there is none. So this is impossible to join this domain and there is no known fix or workaround yet.<br />
<br />
Links:<br />
* [https://www.multifake.net/2013/01/windows-8-not-joining-certain-samba-domains/ Windows 8 joining Samba domains, and which ones it just fails to join (those with dots in their names)]<br />
* [https://lists.samba.org/archive/samba/2013-June/174065.html Fix the Issue Windows 8 cannot join if a example.com domain]<br />
<br />
== IMPORTANT: Registry changes that never should be done! ==<br />
There are many pages on the internet, which suggest to change the values of <tt>RequireSignOrSeal</tt> and <tt>RequireStrongKey</tt>. '''This is <u>NOT</u> recommended by the Samba team, as it will break interoperability with other Windows and Samba versions!'''<br />
<br />
If you have already changed these parameters, turn them back to <tt>1</tt> as shown below and reboot:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CCS\Services\Netlogon\Parameters]<br />
<br />
"RequireSignOrSeal"=dword:00000001<br />
"RequireStrongKey"=dword:00000000</div>Milan.Kerslagerhttps://wiki.samba.org/index.php?title=Required_Settings_for_Samba_NT4_Domains&diff=7965Required Settings for Samba NT4 Domains2013-09-07T20:11:40Z<p>Milan.Kerslager: /* IMPORTANT: Registry changes that never should be done! */ fix format</p>
<hr />
<div>'''Samba usually doesn't require any changes on your Windows OS.''' So please read very carefully on the sections below why and when you should do them! If your situation or problem isn't mentioned here, then it's highly recommented to <u>NOT</u> do any registry changes!'''<br />
<br />
== Joining Windows7/8 or Windows Server 2008r2/2012 to an Samba NT4-style domain ==<br />
<br />
'''This changes are only necessary if you want to join a Windows7/8 or Windows Server 2008r2/2012 machine to a <u>Samba NT4-style domain</u>!<br />
<br />
It's not required and not recommended if you run Samba as AD DC!'''<br />
<br />
If you try to join any of the mentioned OS you'll encounter an error<br />
<br />
The following error occourred attempting to join the domain „.....“:<br />
<br />
The specified domain either does not exist or could not be contacted.<br />
<br />
The following registry change work with any Samba version that isn't already [[Samba_Release_Planning|discontinued]]:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]<br />
<br />
"DomainCompatibilityMode"=dword:00000001<br />
"DNSNameResolutionRequired"=dword:00000000<br />
<br />
Do the changes manually in <tt>regedit.exe</tt> or save the above in a plain text file with Notepad/Editor (not Word/Wordpad/OpenOffice/LibreOffice/...!) and name it <tt>sambafix.reg</tt>. Make sure, that the file has the ending <tt>.reg</tt>. Then you can import it directly to your registry by double-clicking, if you have the sufficient permissions.<br />
<br />
After the next reboot you can join the machine to your domain, but you'll still encounter an error:<br />
<br />
Changing the Primary Domain DNS name of this computer to "" failed. The name will remain ".....".<br />
The error was:<br />
<br />
The specified domain either does not exist or could not be contacted<br />
<br />
But this error can safely be ignored or, if you run Windows 7, silenced by a hotfix, that was published by Microsoft: [http://support.microsoft.com/kb/2171571 KB2171571: You incorrectly receive an error message when you join a computer that is running Windows 7 or Windows Server 2008 R2 to a Samba 3-based domain].<br />
<br />
== Windows 8 and classic domain (NT-4 style) with a dot in its name ==<br />
There is a problem with Windows 8, where Microsoft raises new domain name policy. When a domain contain a dot (".") in its name (ie. ''example.com''), Windows 8 treat this name as a Active Directory name and trying to contact Kerberos/LDAP server even there is none. So this is impossible to join this domain and there is no known fix or workaround yet.<br />
<br />
Links:<br />
* [https://www.multifake.net/2013/01/windows-8-not-joining-certain-samba-domains/ Windows 8 joining Samba domains, and which ones it just fails to join (those with dots in their names)]<br />
* [https://lists.samba.org/archive/samba/2013-June/174065.html Fix the Issue Windows 8 cannot join if a example.com domain]<br />
<br />
== IMPORTANT: Registry changes that never should be done! ==<br />
<br />
There are many pages on the internet, which suggest to change the values of <tt>RequireSignOrSeal</tt> and <tt>RequireStrongKey</tt>. '''This is <u>NOT</u> recommended by the Samba team, as it will break interoperability with other Windows and Samba versions!'''<br />
<br />
If you have already changed these parameters, turn them back to <tt>1</tt> as shown below and reboot:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CCS\Services\Netlogon\Parameters]<br />
<br />
"RequireSignOrSeal"=dword:00000001<br />
"RequireStrongKey"=dword:00000000</div>Milan.Kerslagerhttps://wiki.samba.org/index.php?title=Required_Settings_for_Samba_NT4_Domains&diff=7964Required Settings for Samba NT4 Domains2013-09-07T20:09:42Z<p>Milan.Kerslager: Dot in classic domain name</p>
<hr />
<div>'''Samba usually doesn't require any changes on your Windows OS.''' So please read very carefully on the sections below why and when you should do them! If your situation or problem isn't mentioned here, then it's highly recommented to <u>NOT</u> do any registry changes!'''<br />
<br />
== Joining Windows7/8 or Windows Server 2008r2/2012 to an Samba NT4-style domain ==<br />
<br />
'''This changes are only necessary if you want to join a Windows7/8 or Windows Server 2008r2/2012 machine to a <u>Samba NT4-style domain</u>!<br />
<br />
It's not required and not recommended if you run Samba as AD DC!'''<br />
<br />
If you try to join any of the mentioned OS you'll encounter an error<br />
<br />
The following error occourred attempting to join the domain „.....“:<br />
<br />
The specified domain either does not exist or could not be contacted.<br />
<br />
The following registry change work with any Samba version that isn't already [[Samba_Release_Planning|discontinued]]:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]<br />
<br />
"DomainCompatibilityMode"=dword:00000001<br />
"DNSNameResolutionRequired"=dword:00000000<br />
<br />
Do the changes manually in <tt>regedit.exe</tt> or save the above in a plain text file with Notepad/Editor (not Word/Wordpad/OpenOffice/LibreOffice/...!) and name it <tt>sambafix.reg</tt>. Make sure, that the file has the ending <tt>.reg</tt>. Then you can import it directly to your registry by double-clicking, if you have the sufficient permissions.<br />
<br />
After the next reboot you can join the machine to your domain, but you'll still encounter an error:<br />
<br />
Changing the Primary Domain DNS name of this computer to "" failed. The name will remain ".....".<br />
The error was:<br />
<br />
The specified domain either does not exist or could not be contacted<br />
<br />
But this error can safely be ignored or, if you run Windows 7, silenced by a hotfix, that was published by Microsoft: [http://support.microsoft.com/kb/2171571 KB2171571: You incorrectly receive an error message when you join a computer that is running Windows 7 or Windows Server 2008 R2 to a Samba 3-based domain].<br />
<br />
== Windows 8 and classic domain (NT-4 style) with a dot in its name ==<br />
There is a problem with Windows 8, where Microsoft raises new domain name policy. When a domain contain a dot (".") in its name (ie. ''example.com''), Windows 8 treat this name as a Active Directory name and trying to contact Kerberos/LDAP server even there is none. So this is impossible to join this domain and there is no known fix or workaround yet.<br />
<br />
Links:<br />
* [https://www.multifake.net/2013/01/windows-8-not-joining-certain-samba-domains/ Windows 8 joining Samba domains, and which ones it just fails to join (those with dots in their names)]<br />
* [https://lists.samba.org/archive/samba/2013-June/174065.html Fix the Issue Windows 8 cannot join if a example.com domain]<br />
<br />
== IMPORTANT: Registry changes that never should be done! ==<br />
<br />
There are many pages on the internet, which suggest to change the values of <tt>RequireSignOrSeal</tt> and <tt>RequireStrongKey</tt>. '''This is <u>NOT</u> recommended by the Samba team, as it will break interoperability with other Windows and Samba versions!'''<br />
<br />
If you have already changed these parameters, turn them back to <tt>1</tt> as shown below and reboot:<br />
<br />
[HKEY_LOCAL_MACHINE\System\CCS\Services\Netlogon\Parameters]<br />
<br />
DWORD RequireSignOrSeal = 1<br />
DWORD RequireStrongKey = 1</div>Milan.Kerslagerhttps://wiki.samba.org/index.php?title=Required_Settings_for_Samba_NT4_Domains&diff=7963Required Settings for Samba NT4 Domains2013-09-07T19:53:40Z<p>Milan.Kerslager: Fir registry file format</p>
<hr />
<div>= When do I need Registry changes? =<br />
<br />
'''Samba usually doesn't require any changes on your Windows OS.<br />
<br />
So please read very carefully on the sections below why and when you should do them!<br />
<br />
If your situation or problem isn't mentioned here, then it's highly recommented to <u>NOT</u> do any registry changes!'''<br />
<br />
<br />
<br />
<br />
= Joining Windows7/8 or Windows Server 2008r2/2012 to an Samba NT4-style domain =<br />
<br />
'''This changes are only necessary if you want to join a Windows7/8 or Windows Server 2008r2/2012 machine to a <u>Samba NT4-style domain</u>!<br />
<br />
It's not required and not recommended if you run Samba as AD DC!'''<br />
<br />
If you try to join any of the mentioned OS you'll encounter an error<br />
<br />
The following error occourred attempting to join the domain „.....“:<br />
<br />
The specified domain either does not exist or could not be contacted.<br />
<br />
The following registry change work with any Samba version that isn't already [[Samba_Release_Planning|discontinued]]:<br />
<br />
Windows Registry Editor Version 5.00<br />
<br />
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]<br />
<br />
"DomainCompatibilityMode"=dword:00000001<br />
"DNSNameResolutionRequired"=dword:00000000<br />
<br />
Do the changes manually in <tt>regedit.exe</tt> or save the above in a plain text file with Notepad/Editor (not Word/Wordpad/OpenOffice/LibreOffice/...!) and name it <tt>sambafix.reg</tt>. Make sure, that the file has the ending <tt>.reg</tt>. Then you can import it directly to your registry by double-clicking, if you have the sufficient permissions.<br />
<br />
After the next reboot you can join the machine to your domain, but you'll still encounter an error:<br />
<br />
Changing the Primary Domain DNS name of this computer to "" failed. The name will remain ".....".<br />
The error was:<br />
<br />
The specified domain either does not exist or could not be contacted<br />
<br />
But this error can safely be ignored or, if you run Windows 7, silenced by a hotfix, that was published by Microsoft: [http://support.microsoft.com/kb/2171571 KB2171571: You incorrectly receive an error message when you join a computer that is running Windows 7 or Windows Server 2008 R2 to a Samba 3-based domain].<br />
<br />
= IMPORTANT: Registry changes that never should be done! =<br />
<br />
There are many pages on the internet, which suggest to change the values of <tt>RequireSignOrSeal</tt> and <tt>RequireStrongKey</tt>. '''This is <u>NOT</u> recommended by the Samba team, as it will break interoperability with other Windows and Samba versions!'''<br />
<br />
If you have already changed these parameters, turn them back to <tt>1</tt> as shown below and reboot:<br />
<br />
[HKEY_LOCAL_MACHINE\System\CCS\Services\Netlogon\Parameters]<br />
<br />
DWORD RequireSignOrSeal = 1<br />
DWORD RequireStrongKey = 1</div>Milan.Kerslager