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

Duplicate records created, still with the old IP #21

Open
nicbou opened this issue May 31, 2021 · 9 comments
Open

Duplicate records created, still with the old IP #21

nicbou opened this issue May 31, 2021 · 9 comments

Comments

@nicbou
Copy link

nicbou commented May 31, 2021

My IP address recently changed, and after 24 hours, the DNS record still pointed to the old IP. The logs show multiple (successful?) attempts to update the DNS records, but somehow it failed.

91.64.141.XXX) doesn't match current IP (91.64.142.XXX), sending data={"type": "A", "name": "XXXXX", "data": "91.64.142.XXX"} to url=https://api.digitalocean.com/v2/domains/XXXXXXX.com/records/120829XXX

I logged in to my Digitalocean dashboard, and saw 5-6 duplicate entries for that subdomain in the Networking tab, all showing the old IP.

@nicbou
Copy link
Author

nicbou commented May 31, 2021

Could it be related to kubernetes-sigs/external-dns#503 ?

@tunix
Copy link
Owner

tunix commented Jun 18, 2021

Hi @nicbou ,

Unfortunetely I don't have any ideas. I haven't used this project inside k8s. Such an issue has not been reported before by any user. I guess this might be something with your system? Maybe you can share the logs?

@nicbou
Copy link
Author

nicbou commented Jun 19, 2021

The issue has not reproduced itself. It's probably an issue on DigitalOcean's end.

@tunix tunix closed this as completed Jun 22, 2021
@nicbou
Copy link
Author

nicbou commented Aug 7, 2021

Hi @tunix, unfortunately I had the same problem again today. My ISP assigned me a new IP and my server went offline, but the DNS record was not updated. In digitalocean I see 6 duplicate records, all with the old address. In the docker logs, I see that it tried to update the IP, but it somehow didn't work:

dynamicdns_1       | Trying with ifconfig.co...
dynamicdns_1       | Found IP address 91.64.156.15
dynamicdns_1       | existing DNS record address (91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174) doesn't match current IP (91.64.156.15), sending data={"type": "A", "name": "home", "data": "91.64.156.15"} to url=https://api.digitalocean.com/v2/domains/nicolasbouliane.com/records/151343831
dynamicdns_1       | 158312602
dynamicdns_1       | 158640116
dynamicdns_1       | 158786875
dynamicdns_1       | 158792506
dynamicdns_1       | 159168836
dynamicdns_1       | 159907117
dynamicdns_1       | existing DNS record address (91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.142.174
dynamicdns_1       | 91.64.156.15) doesn't match current IP (91.64.156.15), sending data={"type": "A", "name": "timeline", "data": "91.64.156.15"} to url=https://api.digitalocean.com/v2/domains/nicolasbouliane.com/records/151343833
dynamicdns_1       | 158312609
dynamicdns_1       | 158640118
dynamicdns_1       | 158786878
dynamicdns_1       | 158792508
dynamicdns_1       | 159168837
dynamicdns_1       | 159907119

@nicbou
Copy link
Author

nicbou commented Nov 1, 2021

This issue should not be closed. It's still happening.

@nicbou
Copy link
Author

nicbou commented Jan 31, 2022

This happened once again.

  dynamicdns:
    image: tunix/digitalocean-dyndns
    environment:
      - DIGITALOCEAN_TOKEN
      - DOMAIN=nicolasbouliane.com
      - NAME=home;timeline

My IP changed this morning, and now I have 2 pages of duplicate DNS records, all of which point to the wrong IP address.

@nicbou
Copy link
Author

nicbou commented Jan 31, 2022

I'm starting to see what could be wrong.

dynamicdns_1       | Trying with ifconfig.co...
dynamicdns_1       | Found IP address NEW_IP
dynamicdns_1       | existing DNS record address (OLD_IP
dynamicdns_1       | OLD_IP
[many more duplicate OLD_IP lines]
dynamicdns_1       | NEW_IP) doesn't match current IP (NEW_IP), sending data={"type": "A", "name": "home", "data": "91.65.119.67"} to url=https://api.digitalocean.com/v2/domains/nicolasbouliane.com/records/...
dynamicdns_1       | RECORD_ID
[many more RECORD_IDs]

So it looks like it compares a single IP to a bunch of different IPs, and the strings don't match.

@tunix
Copy link
Owner

tunix commented Feb 1, 2022

Hi @nicbou ,

Have you tried passing REMOVE_DUPLICATES='true' as an environment variable? The script has the ability to remove duplicated DNS records but it's turned off by default. You should see a log message like below:

Unable to update '$sub' domain name as it has duplicate DNS records. Set REMOVE_DUPLICATES='true' to remove them.

Also, do you use the default sleep interval? (which is 5 mins) The script basically checks if the resolved IP address corresponds to the DNS record with the given subname and then creates or updates it.

According to your logs, record_id (at line 44) consists of many records per subdomain but I can't see how that's possible. Do you use the latest Docker image?

@nicbou
Copy link
Author

nicbou commented Feb 1, 2022 via email

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

No branches or pull requests

2 participants