Comments (7)
Create a txt record only with domain and token:
- /v2/domains -> Array with the domains to get the projectId
- /v2/projects/{projectId}/dns-zones -> Array with the dns zones of the project -> get the Id of the dns-zone of your domain
- /v2/dns-zones -> create Subzone with:
{
"name": "_acme-challenge",
"parentZoneId": "zoneId"
}
The response is your new zoneId.
- /v2/dns-zones/{dnsZoneId}/record-sets/{recordSet} -> use the response zoneId and recordSet = txt with the body:
{
"settings": {
"ttl": {
"auto": true
}
},
"entries": [
"test"
]
}
Delete a txt-record:
- /v2/domains -> Array with the domains to get the projectId
- /v2/projects/{projectId}/dns-zones -> Array with the dns zones of the project -> get the Id of the dns-zone of your domain
- /v2/dns-zones/{dnsZoneId} -> delete the dns-zone
Is Mittwald support for multiple TXT entries for the same domain?
Yes you can create multiple entries for _acme-challenge.example.com
just fill them in the entries:
{
"settings": {
"ttl": {
"auto": true
}
},
"entries": [
"test",
"test2"
]
}
from lego.
Hello,
I checked quickly the API documentation, and I didn't find an endpoint to delete a record.
I also didn't find how to get a zone ID or project ID from a domain.
Could you give me more information about those elements?
Sponsoring is a good way to sustain open source maintainers: sponsor me
from lego.
Hello @ldez,
a DNS-Record is connected to a domain and the parent-Zone can not be deleted. It get's deleted when a domain get's deleted.
You only can create sub-zones like mail.DOMAIN.tld via https://api.mittwald.de/v2/docs/#/Domain/dns-create-dns-zone and delete them with https://api.mittwald.de/v2/docs/#/Domain/dns-delete-dns-zone
The projectid you can get when you lists your projects belonging to your user: https://api.mittwald.de/v2/docs/#/Project/project-list-projects and with that id you can list your zones connected to the project: https://api.mittwald.de/v2/docs/#/Domain/dns-list-dns-zones
If there is no way to delete or create parentZones like "mittwald.de", is it possible to get support for lego?
Greetings Jonas
from lego.
ACME DNS-01 challenge requires to create and delete a TXT record (ex: _acme-challenge.example.com
or _acme-challenge.sub.example.com
)
The projectid you can get when you lists your projects belonging to your user: https://api.mittwald.de/v2/docs/#/Project/project-list-projects and with that id you can list your zones connected to the project: https://api.mittwald.de/v2/docs/#/Domain/dns-list-dns-zones
The endpoint /v2/projects
requires the customer ID and the server ID.
How do I get this information based on the API token?
If I follow your explanation, to create a TXT record:
- call
/v2/projects
to get the project ID (but need customer ID and the server ID) - call
/v2/projects/{projectId}/dns-zones
with the project ID to get all the zones (pagination?) - call
/v2/dns-zones
to create a zone (if needed) and get the zone ID. (ex:_acme-challenge.example.com
or_acme-challenge.sub.example.com
)
I didn't find the call to create a TXT record. /v2/dns-zones/{dnsZoneId}/record-sets/{recordSet}/actions/set-managed
allows to create A or MX record only (and the request schema is missing from the doc).
Maybe it's /v2/dns-zones/{dnsZoneId}/record-sets/{recordSet}
but the doc is not clear about that (and the request schema is missing from the doc).
to delete a record:
- call
/v2/projects
to get the project ID (but need customer ID and the server ID) - call
/v2/projects/{projectId}/dns-zones
with the project ID to get all the zones (pagination?) - call
/v2/dns-zones/{dnsZoneId}
with the zone ID to delete the zone (and the TXT record).
from lego.
@jotimann any news?
from lego.
Hello @ldez,
sorry for the late answer.
The endpoint /v2/projects requires the customer ID and the server ID.
The customerID and serverID are not required. If you have your token the API will list your projects which belong to the user in the following schema:
[
{
"createdAt": "2023-08-16T07:57:42.000Z",
"customerId": UUID,
"customerMeta": {
"id": UUID
},
"description": "My Project",
"enabled": true,
"id": UUID,
"isReady": true,
"projectHostingId": UUID,
"readiness": "ready",
"serverId": UUID,
"serverShortId": "......",
"shortId": ".....",
"status": "ready",
"statusSetAt": "2023-12-22T13:47:12.000Z"
}, ...
]
there u will get the projectID, but the response can be multiple projects.
call /v2/projects/{projectId}/dns-zones with the project ID to get all the zones (pagination?)
No the dns-zones-route has no pagination and will get you:
{
"id": UUID,
"domain": "mittwald.de",
"recordSet": {
"mx": {
"managed": true
},
"combinedARecords": {
"managedBy": {
"ingressId": UUID
}
},
"cname": {},
"txt": {
"settings": {
"ttl": {
"auto": true
}
},
"entries": [
"v=spf1 include:agenturserver.de ~all"
]
},
"srv": {}
}
},
with that id you can call https://api.mittwald.de/v2/docs/#/Domain/dns-create-dns-zone
name e.g. "_acme-challenge" and parentZoneId is always the id of the dns-zone in your case example.com
The response from your post on /v2/docs/#/Domain/dns-create-dns-zone
is the id
of the new dns-zone of "_acme-challenge.example.com".
Last step you can set the correct txt-record via https://api.mittwald.de/v2/docs/#/Domain/dns-update-record-set
{
"settings": {
"ttl": {
"auto": true
}
},
"entries": [
"txt-value"
]
}
To delete the record you use https://api.mittwald.de/v2/docs/#/Domain/dns-delete-dns-zone with the zoneID
I hope I got everything and thanks for your work :)
Greetings
from lego.
but the response can be multiple projects.
How do I get the project ID when I only have a domain and a token?
No the dns-zones-route has no pagination and will get you:
The documentation about /v2/projects/{projectId}/dns-zones
says: "List DNSZones belonging to a Project." and "An array of DNSZone objects."
- Can you give me a list of the calls to create only one TXT record based only on a token and a domain name?
- Can you give me a list of the calls to remove only one TXT record based only on a token and a domain name?
- Is Mittwald support for multiple TXT entries for the same domain?
from lego.
Related Issues (20)
- Leftover deprecated update renewal info call
- Need new release HOT 1
- lego allows using subdomain DNS to obtain Let's Encrypt wildcard certificates HOT 4
- Support for provider: Strato HOT 7
- google domains Error 400: Precondition check failed., failedPrecondition HOT 3
- make overallRequestLimit an option HOT 4
- Zone apex Subject alternative name not working with wildcards HOT 10
- could not determine authoritative nameservers
- Suppress "no renewal" message on renew HOT 1
- ovh: allow to use ovh.conf HOT 6
- Lego v4 digitalocean.DNSProvider does not implement acmez.Solver (certmagic) HOT 1
- zerossl RFC8738 certificate issuing for IP address not working HOT 2
- cloudflare: can't obtain certificates from LE with dns challenge HOT 4
- inwx: local DNS doesn't answer to SOA calls HOT 4
- BlueCat cleanup fails so no cert created HOT 11
- Support for provider: nsd HOT 4
- Helmchart for lego HOT 1
- On success, print a message that contains the absolute path of the .lego directory.
- Tencent cloud cannot be successfully generated through DNS HOT 5
- Fails to obtain/renew certificate using godaddy HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lego.