Files
ddns-updater-qdm12-3/docs/porkbun.md
Benjamin Temple 4254600bcf Provider Porkbun: Delete Default Parked DNS Entry for *.domain.tld (#774)
* Provider Porkbun: Delete Default Parked DNS Entry for *.domain.tld

Description:

By default, 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.
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 values.
If the value does not match the expected `pixie.porkbun.com` we produce more helpful error messages.

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.

![screenshot_2024-08-17-0210 20](https://github.com/user-attachments/assets/eb567401-ad4b-454d-a7aa-70ab1db1e3e9)

- add `deleteDefaultConflictingRecordsIfNeeded` method
- handle non conflicting errors from `deleteSingleMatchingRecord`
- simplify comments by linking to documentation
- improve error wrappings

---------

Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
2024-10-07 21:46:12 -07:00

2.2 KiB

Porkbun

Configuration

Example

{
  "settings": [
    {
      "provider": "porkbun",
      "domain": "domain.com",
      "api_key": "sk1_7d119e3f656b00ae042980302e1425a04163c476efec1833q3cb0w54fc6f5022",
      "secret_api_key": "pk1_5299b57125c8f3cdf347d2fe0e713311ee3a1e11f11a14942b26472593e35368",
      "ip_version": "ipv4",
      "ipv6_suffix": ""
    }
  ]
}

Compulsory Parameters

  • "domain" is the domain to update. It can be example.com (root domain), sub.example.com (subdomain of example.com) or *.example.com for the wildcard.
  • "api_key"
  • "secret_api_key"
  • "ttl" optional integer value corresponding to a number of seconds

Optional parameters

  • "ip_version" can be ipv4 (A records), or ipv6 (AAAA records) or ipv4 or ipv6 (update one of the two, depending on the public ip found). It defaults to ipv4 or ipv6.
  • "ipv6_suffix" is the IPv6 interface identifier suffix to use. It can be for example 0:0:0:0:72ad:8fbb:a54e:bedd/64. If left empty, it defaults to no suffix and the raw public IPv6 address obtained is used in the record updating.

Domain setup

💁 Official setup documentation

Record creation

In case you don't have an A or AAAA record for your host and domain combination, it will be created by DDNS-Updater.

Porkbun creates default DNS entries for new domains, which can conflict with creating a root or wildcard A/AAAA record. Therefore, ddns-updater automatically removes any conflicting default record before creating records, as described in the table below:

Record type Owner Record value Situation requiring a removal
ALIAS @ pixie.porkbun.com Creating A or AAAA record for the root domain or wildcard domain
CNAME * pixie.porkbun.com Creating A or AAAA record for the wildcard domain

More details is in this comment by @everydaycombat.