ddns_removals will not remove reverse DNS if a A or AAAA record remains
René GARCIA
rene.garcia at sogeti.com
Thu Jul 16 13:56:13 UTC 2009
Hi,
If you are in a situation where both IPv4 and IPv6 DNS data for a same
machine has been recorded in DNS via DHCP DDNS you shoud have 5 records in
DNS :
IPV4 forward resolution (A)
IPV6 forward resolution (AAAA)
DHCID (TXT for now)
IPV4 reverse resolution (PTR)
IPV6 reverse resolution (PTR)
when a lease expires or client sends DHCPRELEASE, DHCP server should remove
forward and reverse records for the selected protocol and keep the remaining
protocol with the DHCID.
In fact, the ddns_removals function (in server/ddns.c) calls the function
ddns_remove_fwd (in common/dns.c) to remove forward reolution and if the
return code is ISC_R_SUCCESS it will call the ddns_remove_ptr to remove
reverse resolution.
Unfortunalety the ddns_remove_fwd will not return ISC_R_SUCCESS if forward
record has been removed but DHCID could not be removed. This happends when a
forward record remains (A when removing AAAA or AAAA when removinf A).
This is a patch to prevent this :
------- START OF PATCH -------
*** common/dns.c Thu Mar 26 18:20:23 2009
--- common/dns-merge.c Thu Jul 16 15:54:32 2009
***************
*** 826,832 ****
struct data_string *ddns_dhcid) {
ns_updque updqueue;
ns_updrec *updrec;
! isc_result_t result = SERVFAIL;
char ddns_address[
sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
int ddns_address_type;
--- 826,833 ----
struct data_string *ddns_dhcid) {
ns_updque updqueue;
ns_updrec *updrec;
! isc_result_t result = SERVFAIL,
! dhcid_result = SERVFAIL;
char ddns_address[
sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
int ddns_address_type;
***************
*** 1014,1021 ****
/*
* Attempt to perform the update.
*/
! result = minires_nupdate (&resolver_state, ISC_LIST_HEAD
(updqueue));
! print_dns_status ((int)result, &updqueue);
/* Fall through. */
error:
--- 1015,1022 ----
/*
* Attempt to perform the update.
*/
! dhcid_result = minires_nupdate (&resolver_state, ISC_LIST_HEAD
(updqueue));
! print_dns_status ((int)dhcid_result, &updqueue);
/* Fall through. */
error:
------- END OF PATCH -------
Regards,
René GARCIA
More information about the dhcp-workers
mailing list