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

ddclient: allow hostname starting with dot for porkbun provider #3965

Open
3 tasks done
danielegovetto opened this issue May 4, 2024 · 0 comments
Open
3 tasks done

Comments

@danielegovetto
Copy link

danielegovetto commented May 4, 2024

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.
Right now with porkbun as provider and ddclient as backend, you can only update subdomain (aaa.example.com, bbb.example.com), if you put the root domain example.com the update fails.

Describe the solution you'd like
Putting as hostname .example.com the update of the dns record works, but you can't do that in the ui because the validation return the error "Please specify a valid IP address or hostname". I'd like to allow that hostname.

Additional context
After a bit of trial and error with plain ddclient I found that this configuration works as expected (notice the starting dot in the domain):

protocol=porkbun \
apikey=pk1_xxx \
secretapikey=sk1_xxx \
root-domain=example.com
.example.com

In OPNsense I had to manually edit the file /usr/local/etc/ddclient.json changing the "hostnames" key, after a restart of the plugin the DNS record was correctly updated, but obviously this is not a permanent fix becasue the manual edit is lost every time you apply the configuration from the WebUI.

Without this fix the update fails because ddclient call this API to check the if the domain exists:

https://porkbun.com/api/json/v3/dns/retrieveByNameType/[HOSTNAME]/A/[SUBDOMAIN]

With a hostname aaa.example.com the actual url called is:

https://porkbun.com/api/json/v3/dns/retrieveByNameType/example.com/A/aaa

The SUBDOMAIN is optional to allow update of the root domain, but right now if you put example.com as hostname the url look like this:

https://porkbun.com/api/json/v3/dns/retrieveByNameType/com/A/example

and this calls fails because com is not a valid domain name. With a dot at the start, the domain is correctly parsed and the url is:

https://porkbun.com/api/json/v3/dns/retrieveByNameType/example.com/A/

Porkbun API documentation: https://porkbun.com/api/json/v3/documentation

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

No branches or pull requests

1 participant