[Samba] DNS forwading for host *within* AD

George jorgito1412 at gmail.com
Tue Sep 17 23:54:15 CEST 2013


For the record, I couldn't make it a work in a more elegant way, so here's
the "quick and dirty" solution (using the internal DNS server). I run this
script every 10 minutes or so via cron.

This updates the record for "www.foo.com" considering the AD domain is "
foo.com" and the webserver "www.foo.com" is hosted externally. dc1 is the
domain controller, 8.8.8.8 in this case is Google DNS servers:

--
#!/bin/bash

WWW_CURRENT=`dig @localhost www.foo.com A +short | tail -n1`
WWW_NEW=`dig @8.8.8.8 www.foo.com A +short | tail -n1`

if [ $WWW_CURRENT != $WWW_NEW ] && [ ! -z $WWW_NEW ]
then
    /usr/local/samba/bin/samba-tool dns update dc1 foo.com www A
$WWW_CURRENT $WWW_NEW --password=adminpassword
fi
--

Regards!


On Mon, Sep 2, 2013 at 2:57 PM, George <jorgito1412 at gmail.com> wrote:

> Hi, I am currently running Samba 4.0.9 as a DC.
>
> My AD domain and Kerberos realm is "domain.com". Although this was not
> considered when we set up the domain, now we need "foo.domain.com" to be
> resolved externally by our ISP DNS server.
>
> I tried to configure BIND as a backend and to manuallly add a zone "
> foo.domain.com", type forward, but it does not work (Samba DLZ seems to
> be taking precedence). Any suggestions??
>
> A somewhat cheap hack would be to add an A record for "foo" and make a
> cron script to update it with samba-tool on a regular basis. But first I
> would like to get a more proper solution.
>
> Thanks a lot.
>
> George
>


More information about the samba mailing list