ddns-updater
ddns-updater copied to clipboard
Provider Porkbun: Delete Default Parked DNS Entry for *.domain.tld
Description:
Porkbun creates default ALIAS and CNAME domain records pointing to pixie.porkbun.com (Porkbun's parked domain website)
The current logic flow prior to this PR would look for an A or AAAA domain record, and if none exists, attempt to delete the ALIAS record for any subdomain and then proceed with the record creation.
This updates the logic flow to only look for a conflicting ALIAS record for the top level domain.tld, and a conflicting CNAME record for the *.domain.tld. Additionally, we verify that the content of this record matches pixie.porkbun.com and we only delete for the expected default value.
If the value does not match the expected pixie.porkbun.com we produce more helpful error messages.
Note: Any other domain name we simply attempt to create a record if no record exists, which will return a 400 error with no helpful error reason if there is a conflicting record of another type. We may want to consider checking for any conflicting records to produce a more helpful error for the user, but that change is well outside of the scope of this PR, and should likely be done in a more general way and apply to all DNS providers, rather than porkbun exclusively.
Test-Plan:
Created a new domain.tld on Porkbun
Verified the default records were created:
ALIAS domain.tld -> pixie.porkbun.com
CNAME *.domain.tld -> pixie.porkbun.com
Started DDNS-Updater
Verified that both domain records were successfully deleted and updated
Reset the ALIAS domain record to point to not-pixie.porkbun.com
Reset the CNAME domain record to point to not-pixie.porkbun.com
Started DDNS-Updater
Verified that both domain records failed with the expected conflicting record error message.