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

Creates duplicates IPs in DNS #43

Open
marioja opened this issue Aug 21, 2023 · 7 comments
Open

Creates duplicates IPs in DNS #43

marioja opened this issue Aug 21, 2023 · 7 comments

Comments

@marioja
Copy link

marioja commented Aug 21, 2023

If you have existing A records in DNS then the diskstation_dns_modify.sh script when run for the first time will create duplicate A records in DNS. The problem is that those records cannot be deleted using the GUI. I had to do surgery to correct this.

@gclayburg
Copy link
Owner

Ok, so in your case you already manually added a DNS record for one or more of the hosts that have been given a dynamic address by DHCP? This script does not consider that case. Like you said, this script just adds an A record for each dymanic address it finds. Should this script do something different? How would it know which existing names in DNS should not be added?

@Gandulf78
Copy link

Gandulf78 commented Oct 14, 2023

Ok, so in your case you already manually added a DNS record for one or more of the hosts that have been given a dynamic address by DHCP? This script does not consider that case. Like you said, this script just adds an A record for each dymanic address it finds. Should this script do something different? How would it know which existing names in DNS should not be added?

Hi.
I believe I have the same issue. After a reboot all my customized static DHCP configuration has been lost. I had to recreate it manually. In the meantime, the newly random IP attributed by DHCP have been imported in the A records. Now, i have some duplicated A records in the DNS A records (several times the same IP adresses). I would like to have it cleaned up. Is it something doable?
Thanks you.

@gclayburg
Copy link
Owner

So if you use this script, there will basically 2 types of A records.

  1. records created manually in the GUI
  2. records created automatically by this script.

When this script runs again, it will check the dhcp changes and update DNS, but only for the records of type 2. The script tries to not change anything for records of type 1. If your DNS was "misconfigured" to start with, i.e. you had some entries of type 1 that you created to reflect a dynamic address before using this script, it might be possible that things get confused.

The best practice is to start with a DNS that does not have any type 1 records that map to a dynamic address assigned by DHCP - let this script handle that part.

@Gandulf78
Copy link

So if you use this script, there will basically 2 types of A records.

  1. records created manually in the GUI
  2. records created automatically by this script.

When this script runs again, it will check the dhcp changes and update DNS, but only for the records of type 2. The script tries to not change anything for records of type 1. If your DNS was "misconfigured" to start with, i.e. you had some entries of type 1 that you created to reflect a dynamic address before using this script, it might be possible that things get confused.

The best practice is to start with a DNS that does not have any type 1 records that map to a dynamic address assigned by DHCP - let this script handle that part.

On my side, I am pretty sure I didn't create any record manually but yet I have some duplicates.
How can I clean it up?

@gclayburg
Copy link
Owner

what version of DSM are you running?

@Gandulf78
Copy link

what version of DSM are you running?

DSM 7.2.1 update 1

@gclayburg
Copy link
Owner

ok. I haven't tried this script with DSM 7 and I have no ability to test it either. Maybe someone else that is running DSM 7 can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants