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

Add DNSAPI for DNS provider Beget #3952

Open
Captd65 opened this issue Feb 22, 2022 · 5 comments
Open

Add DNSAPI for DNS provider Beget #3952

Captd65 opened this issue Feb 22, 2022 · 5 comments

Comments

@Captd65
Copy link

Captd65 commented Feb 22, 2022

Is it possible to add dns api for the provider Beget (https://beget.com/ru)
https://beget.com/ru/kb/api/funkczii-upravleniya-dns

@retifrav
Copy link

retifrav commented Jan 10, 2024

I wanted to implement this, but very soon discovered that there is no way to add a single record, as you can only send a JSON object with all the records that need to be set.

For example, having executed a changeRecords query like this:

{"fqdn":"your.domain","records":{"TXT":[{"priority":10,"value":"ololo"}]}}

you'll end up fekkin overriding all your A, MX and TXT records, so the only record you'll have is this TXT record with the value ololo. How amazing is that.

So a "correct" procedure would be to first get that A/MX/TXT "triplet" of records with getData, form a new JSON object (as the format of the result isn't the same), add a new TXT record to that object and post the final object with changeRecords.

Yeah, nah, don't know about the others, but I personally won't be implementing this. They (Beget) really should make a more civilized API.

@woxxo
Copy link

woxxo commented Jun 24, 2024

overriding all your A, MX and TXT records

You should not override A and MX records at all, only add TXT record for the automatically generated "_acme-challenge" subdomain. If you use "fqdn":"_acme-challenge.your.domain", all dns records for your domain remain untouched.
As for wildcards, the easiest and the dirtiest way is to save your first TXT record with _saveaccountconf_mutable, and then restore it with _readaccountconf_mutable to combine with the second TXT.

Example: {"fqdn":"_acme-challenge.your.domain","records":{"TXT":[{"priority":10,"value":"ololo"}]}}

@retifrav
Copy link

retifrav commented Jun 24, 2024

That is a good point, I don't remember why I haven't tried with _acme-challenge.your.domain and went with the bare your.domain instead.

@oshurkov
Copy link

I tested it, everything went well. Example of a request with urlencode

Call

https://api.beget.com/api/dns/changeRecords?login=secret_user&passwd=secret_pwd&input_format=json&output_format=json&input_data=%7B%22fqdn%22%3A%22_acme-challenge.example.com%22%2C%22records%22%3A%7B%22TXT%22%3A%5B%7B%22priority%22%3A10%2C%22value%22%3A%22generate_key_in_acme_ololo%22%7D%5D%7D%7D

Response

{"status":"success","answer":{"status":"success","result":true}}

@ARNik
Copy link

ARNik commented Jan 15, 2025

Add Beget.com DNS API support #6202

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

6 participants