[Samba] dhcp-dyndns.sh creates no PTR entry

Ingo Asche foren at asche-rz.de
Fri Nov 12 12:22:29 UTC 2021

Let's not start that discussion... :-)

I got similar lines in my syslog and also only IPv4, that's not the problem.

I think the problem begins in line 230 for example in your script:
ReverseZones=$($SAMBATOOL dns zonelist ${Server} $KTYPE --reverse | grep 
'pszZoneName' | awk '{print $NF}')

If I use this command manually I get in my case this back:

If I add a "sort" at the end the IPv4 reverse zone is listed first, then 
it's working. Wouldn't it be the same if you have two IPv4 reverse 
zones? So I think the script might not be capable to pick the correct 
zone regardless the second zone is an IPV6 zone or another IPv4 zone.

I've created two more IPv4 reverse zones just for testing. That's what 
I've got then:



Rowland Penny via samba schrieb am 12.11.2021 um 11:48:
> On Fri, 2021-11-12 at 10:17 +0100, Ingo Asche via samba wrote:
>> Hi Rowland,
>> with the change in the failover DHCP configuration all works well
>> now,
>> I've get only only one DNS entry in the forward lookup zone.
>> But I just realized that there is no creating of an entry in the
>> reverse
>> lookup zone.
>> I might found the problem: I also have a reverse lookup zone for my
>> IPv6
>> segment and this zone is found first, don't matches the IP address
>> given
>> and so no PTR entry will be created.
> I do not use IPv6, it is one of the first things I turn off. I cannot
> understand why anyone would use it on an internal network, it is
> unlikely that 340 trillion trillion trillion IP addresses would be
> needed.
> When the script runs, it produces lines like these in /var/log/syslog
> dhcpd[641]: execute_statement argv[0] = /usr/local/bin/dhcp-dyndns.sh
> dhcpd[641]: execute_statement argv[1] = add
> rpidc2 dhcpd[641]: execute_statement argv[2] =
> rpidc2 dhcpd[641]: execute_statement argv[3] = dc:a6:32:dd:66:10
> rpidc2 dhcpd[641]: execute_statement argv[4] = rpi400
> If you can find similar lines in your /var/log/sysvol that refer to
> IPv4 and IPv6 for the same hostname, I should be able to fix this.
> Rowland

More information about the samba mailing list