Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] for dynamic zone, import ok, but no record deletion #413

Closed
5 tasks done
JRMoret opened this issue Aug 2, 2018 · 6 comments
Closed
5 tasks done

[ISSUE] for dynamic zone, import ok, but no record deletion #413

JRMoret opened this issue Aug 2, 2018 · 6 comments

Comments

@JRMoret
Copy link

@JRMoret JRMoret commented Aug 2, 2018

Replace everything between stars with current version of your facileManager and module installations:
fM Version : 3.1.1
fmDNS Version : 3.1.2

In raising this issue, I confirm the following (please check boxes, eg [X]):

  • I have read and understood the contributors guide.
  • I have checked that the bug-fix I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked that the issue I'm posting isn't already reported.
  • I have checked that the issue I'm posting isn't already solved and no duplicates exist in closed issues and opened issues
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.

Hello,

I have a issue with a dynamic zone, the records supposed to be deleted are not

Ex :
I made a modification on my zone with nsupdate:
nsupdate

update del testjrm99.mydomain.fr A 127.0.0.106
update add testjrm99.mydomain.fr 86400 A 127.0.0.107
send
quit

My record is well changed:
nslookup

testjrm99.mydomain.fr
Name: testjrm99.mydomain.fr
Address: 127.0.0.107

I enter in this zone with "fmDNS", it checks the last modification and show me the recordings to import:
syslog
Aug 2 12:29:28 srv-cha-ns00-v fmDNS: Updated a record (testjrm99) with the following details:
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Domain: mydomain.fr
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Type:
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Class: IN
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Type: A
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Status: deleted
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Append: yes
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: Added a record with the following details:
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Domain: mydomain.fr
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Type: A
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Name: testjrm99
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Ttl: 86400
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Class: IN
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Value: 127.0.0.107
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: --> Append: yes
Aug 2 12:29:29 srv-cha-ns00-v fmDNS: Imported 1 record from '/tmp/db.mydomain.fr' into mydomain.fr.
Aug 2 12:29:50 srv-cha-ns00-v fmDNS: Reloaded zone 'mydomain.fr'.

When i import, the record in the status deleted is not deleted in fmDNS.
I reload the zone, and now i have record with both IPs :
nslookup

testjrm99.mydomain.fr
Name: testjrm99.mydomain.fr
Addresses: 127.0.0.107
127.0.0.106

Do you have a issue for this problem, or it's bug ?

Thank you

@JRMoret JRMoret changed the title [ISSUE] for dynamic zone, import ok, so not delete record. [ISSUE] for dynamic zone, import ok, but not delete record. Aug 3, 2018
@JRMoret JRMoret changed the title [ISSUE] for dynamic zone, import ok, but not delete record. [ISSUE] for dynamic zone, import ok, but no record deletion Aug 3, 2018
@JRMoret
Copy link
Author

@JRMoret JRMoret commented Aug 3, 2018

Zone mydomain.fr dynamic

image

I have no record testjrm99

image

I add record testjrm99 with nsupdate.
nsupdate

update add testjrm99.mydomain.fr 300 A 127.0.0.100
send
quit

I go zone mydomain.fr

image

I import

image

OK good

After reload, i verify

nslookup

testjrm99.mydomain.fr
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: testjrm99.mydomain.fr
Address: 127.0.0.100
exit

I change the record testjrm99 IP with nsupdate

nsupdate

update del testjrm99.mydomain.fr A
update add testjrm99.mydomain.fr 300 A 127.0.0.101
send
quit

I verify

nslookup

testjrm99.mydomain.fr
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: testjrm99.mydomain.fr
Address: 127.0.0.101
exit

It seems to be ok

I go zone mydomain.fr

image

I see the delete record
I import

image

The record that should be deleted is not, that's my problem.

After reload zone
I have both recordings.
nslookup

testjrm99.mydomain.fr
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: testjrm99.mydomain.fr
Address: 127.0.0.101
Name: testjrm99.mydomain.fr
Address: 127.0.0.100
exit

In this test, I only have one record.
In my production, I have more than 300 records which changes regularly.
My real zone is a dynamic zone, use dynamic dns with the web-nsupdate project.

how can I fix this problem ?

@WillyXJ
Copy link
Owner

@WillyXJ WillyXJ commented Aug 5, 2018

Thanks for the report. It appears to be a bug that I'll need to investigate and resolve.

@JRMoret
Copy link
Author

@JRMoret JRMoret commented Sep 5, 2018

Hello,
By study, between the manual deletion and the deletion in import, I noticed that there is missing a parameter in in the form <input name = "record_type" value = "A" type = "hidden">
So I have temporarily solved my problem by adding the following lines in the code of the class_tools.php file from line 495.

if ( $action == "Delete") {
		  $row .= '<input type="hidden" name="record_type" value="' . $array['record_type'] . '" />';	
		}

cordially

@JRMoret
Copy link
Author

@JRMoret JRMoret commented Sep 6, 2018

*** class_tools.php     2018-09-06 10:28:18.684473327 +0000
--- /var/www/html/facileManager/fm-modules/fmDNS/classes/class_tools.php        2018-09-05 15:20:54.000000000 +0000
*************** BODY;
*** 492,497 ****
--- 492,500 ----
                $row .= "</td>\n";
                $row .= '<td><input type="hidden" name="' . $db_action . '[' . $id . '][record_class]" value="' . $array['record_class'] . '" />' . $array['record_class'] . '</td>' . "\n";
                $row .= '<td><input type="hidden" name="' . $db_action . '[' . $id . '][record_type]" value="' . $array['record_type'] . '" />' . $array['record_type'] . "</td>\n";
+               if ( $action == "Delete") {
+                 $row .= '<input type="hidden" name="record_type" value="' . $array['record_type'] . '" />';
+               }
                $row .= '<td>';
                if (array_key_exists('record_weight', $array)) {
                        $row .= $editable ? '<span id="priority' . $id . '" onclick="exchange(this);">' . $array['record_priority'] . '</span><input onblur="exchange(this);" type="text" id="priority' . $id . 'b" name="' . $db_action . '[' . $id . '][record_priority]" value="' . $array['record_priority'] . '" />' : $array['record_priority'];

@WillyXJ
Copy link
Owner

@WillyXJ WillyXJ commented Oct 10, 2018

Thanks for the fix - I've tested and merged it into the next release.

@WillyXJ
Copy link
Owner

@WillyXJ WillyXJ commented Oct 26, 2018

This is now fixed in fmDNS 3.2 and later.

@WillyXJ WillyXJ closed this Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants