[Samba] Conflict entries in DNS with DHCP and dynamic DNS updates 

Rowland penny rpenny at samba.org
Fri Feb 19 17:32:00 UTC 2021


On 19/02/2021 17:01, Samba Fan via samba wrote:
> I have checked the DHCP configuration. The failover node configuration has a split of 128 because load balancing should also be performed between both servers. It is correct that both servers should not offer an IP address at the same time. This is also not observed in the log. I describe exemplarily, how the procedure is evident from the log:
>
> DHCP server 1 gets a DHCP discover from MAC address "A" and says "load balance to peer dhcp-failover". It does not give any address to the client with MAC address "A" (no DHCPOFFER is sent). However, it still fires the on-commit event and therefore runs the Dynamic DNS script on DHCP server 1.
> DHCP server 2 receives a DHCP Discover from MAC address "A" at the same time as DHCP server 1 and then sends a DHCPOFFER to the client with MAC address "A". The on-commit event is triggered and thus also the Dynamic DNS script is executed on DHCP server 2.
>
> The problem in my eyes is not that both servers offer an IP address at the same time - which does not happen - but that the on-commit event is executed on both - which in my eyes is illogical and unnecessary. It should only be executed on the server that sends the DHCPOFFER or offers the IP.
>
> Is it possible to include a query if a load balancing to the other server "failover-peer" was executed and in this case not to start the script?
>

If the dhcp server on both machines is running the script, then it has 
nothing to do with the script. If you read 'man dhcpd.conf' you will 
find this:

The split statement

split bits;

The split statement specifies the split between the primary and 
secondary for the purposes of load balancing. Whenever a client makes a 
DHCP request, the DHCP server runs a
hash on the client identification, resulting in value from 0 to 255. 
This is used as an index into a 256 bit field. If the bit at that index 
is set, the primary is responsible.
If the bit at that index is not set, the secondary is responsible. The 
split value determines how many of the leading bits are set to one. So, 
in practice, higher split
values will cause the primary to serve more clients than the secondary. 
Lower split values, the converse. Legal values are between 0 and 256 
inclusive, of which the most
reasonable is 128. Note that a value of 0 makes the secondary 
responsible for all clients and a value of 256 makes the primary 
responsible for all clients.


Which to me, reads as a higher split number makes that dhcp server 
responsible for more clients, '128' being in the middle should make each 
dhcp server responsible for the same number of computers, but I would 
have thought it would only run the script on one dhcp server, if it is 
running the script on both dhcp servers with the same data, then this is 
an isc-dhcp-server bug.

To be honest, I have never used the script in load balancing, I have 
only used it for failover as shown on the wiki page.

Rowland




More information about the samba mailing list