} else {
int updateTTL=0;
foundRecord = false;
+ bool lowerCase = false;
+ if (rrType.getCode() == QType::PTR ||
+ rrType.getCode() == QType::MX ||
+ rrType.getCode() == QType::SRV) {
+ lowerCase = true;
+ }
+ string content = rr->d_content->getZoneRepresentation();
+ if (lowerCase) content = toLower(content);
for (auto& i : rrset) {
- string content = rr->d_content->getZoneRepresentation();
- if (rrType == i.qtype.getCode() && i.getZoneRepresentation() == content) {
+ string icontent = i.getZoneRepresentation();
+ if (lowerCase) icontent = toLower(icontent);
+ if (rrType == i.qtype.getCode() && icontent == content) {
foundRecord=true;
if (i.ttl != rr->d_ttl) {
i.ttl = rr->d_ttl;
--- /dev/null
+#!/bin/sh
+echo == Verify RRset absence
+cleandig ptr1.test.dyndns PTR
+
+echo
+echo == Add PTR
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add ptr1.test.dyndns. 3600 PTR host-2.test.dyndns.
+send
+answer
+!
+
+echo
+echo == Verify PTR presence
+cleandig ptr1.test.dyndns PTR
+
+echo
+echo == Add the PTR again
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add ptr1.test.dyndns. 3600 PTR HOST-2.test.dyndns.
+send
+answer
+!
+
+echo
+echo == Verify that we have one PTR
+cleandig ptr1.test.dyndns PTR
+
+echo
+echo == Clean up
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete ptr1.test.dyndns. PTR
+send
+answer
+!
+
+echo
+echo == Verify RRset absence
+cleandig ptr1.test.dyndns PTR
--- /dev/null
+== Verify RRset absence
+1 test.dyndns. IN SOA 3600 ns1.test.dyndns. ahu.example.dyndns. 2019082709 28800 7200 604800 86400
+Rcode: 3 (Non-Existent domain), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='ptr1.test.dyndns.', qtype=PTR
+
+== Add PTR
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns. IN SOA
+
+
+== Verify PTR presence
+0 ptr1.test.dyndns. IN PTR 3600 host-2.test.dyndns.
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='ptr1.test.dyndns.', qtype=PTR
+
+== Add the PTR again
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns. IN SOA
+
+
+== Verify that we have one PTR
+0 ptr1.test.dyndns. IN PTR 3600 host-2.test.dyndns.
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='ptr1.test.dyndns.', qtype=PTR
+
+== Clean up
+Answer:
+;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id]
+;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
+;; ZONE SECTION:
+;test.dyndns. IN SOA
+
+
+== Verify RRset absence
+1 test.dyndns. IN SOA 3600 ns1.test.dyndns. ahu.example.dyndns. 2019082711 28800 7200 604800 86400
+Rcode: 3 (Non-Existent domain), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='ptr1.test.dyndns.', qtype=PTR