[Samba] joining second DC to domain and non creation of DC DNS records

L.P.H. van Belle belle at bazuin.nl
Fri Oct 23 12:12:10 UTC 2015


> 
> You are missing the point as well, I joined the second DC and the New
> DCs A record was *not* created. I tried to follow the instructions on
> the Samba wiki but had problems and missed the fix on the webpage.
> 
> I then removed the /usr/local/samba directory and re-ran 'make install'
> and then joined the DC again, exactly as I did the first time and
> everything worked as it should, all the CNAME records were created and I
> didn't need to change anything other than what I would normally do i.e.
> /etc/resolv.conf
> 
> So, until the bug is fixed, I 'think' the cure is, add the new DCs A
> record to AD before doing the join.
> 
> Rowland
> 
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba

[L.P.H. van Belle] 

This is an old bug, which is handled by my scripts for some time now ;-) 


If you take this code and run it after install its fixed. 
################################
#!/bin/bash 
SETDNSDOMAIN=`hostname -d`
SETHOSTNAME=`hostname -s`
BIND9_IP_ADDC=`hostname -i`
SAMBA_NT_ADMIN="Administrator"
SAMBA_NT_ADMIN_PASS="PUT_YOUR_ADMINISTRATOR_PASSWORD_HERE"


## the if the needed dns entries for kerberos are there.
if [ -z "`host -t SRV _ldap._tcp.${SETDNSDOMAIN}. | grep 'not found'`" ]; then
     echo "testing of : host -t SRV _ldap._tcp.${SETDNSDOMAIN}. : ok"
     TEST1=0
else
     echo "testing of : host -t SRV _ldap._tcp.${SETDNSDOMAIN}. : FAILED"
     TEST1=1
fi
if [ -z "`host -t SRV _kerberos._udp.${SETDNSDOMAIN}. | grep "not found" `" ]; then
    echo "testing of : host -t SRV _kerberos._udp.${SETDNSDOMAIN}. : ok";
    TEST2=0; 
else     
    echo "testing of : host -t SRV _kerberos._udp.${SETDNSDOMAIN}. : FAILED";
    TEST2=1; 
fi
if [ -z "`host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}. | grep "not found" `" ]; then
    echo "testing of : host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}. : ok";
    TEST3=0; 
else     
    echo "testing of : host -t A ${SETHOSTNAME}.${SETDNSDOMAIN}. : FAILED";
    echo "trying to fix it now: ";
    echo ${SAMBA_NT_ADMIN_PASS}| samba-tool dns add ${SETHOSTNAME}.${SETDNSDOMAIN} ${SETDNSDOMAIN} ${SETHOSTNAME} A ${BIND9_IP_ADDC} -U${SAMBA_NT_ADMIN};
fi

######### Add reverse DNS zone to samba ( a must ! )

REVERSEZONE=`echo $BIND9_IP_ADDC | awk 'BEGIN { FS = "." } ; { print $3"."$2"."$1}'`
SINGLEDC1IPNUMBER=`echo $BIND9_IP_ADDC | rev | cut -d"." -f1 | rev`
echo "creating reverse zone: ${REVERSEZONE}.in-addr.arpa "
echo ${SAMBA_NT_ADMIN_PASS}| samba-tool dns zonecreate ${SETHOSTNAME}.${SETDNSDOMAIN} ${REVERSEZONE}.in-addr.arpa -U${SAMBA_NT_ADMIN}
sleep 2
echo "adding : ${SETHOSTNAME}.${SETDNSDOMAIN}  in reverse zone ( creating PTR ) "
echo -n "PTR of ${SETHOSTNAME}.${SETDNSDOMAIN} : "
echo ${SAMBA_NT_ADMIN_PASS}| samba-tool dns add ${SETHOSTNAME}.${SETDNSDOMAIN} ${REVERSEZONE}.in-addr.arpa ${SINGLEDC1IPNUMBER} PTR ${SETHOSTNAME}.${SETDNSDOMAIN} -U${SAMBA_NT_ADMIN}
################################ 





More information about the samba mailing list