POST/api/v1/projects/{project_id}/domains/{domain_id}/dns/apply
apply_dns_records
Applies a sending domain’s required DNS records through its provider.
- Call it
- after
add_sending_domainfor a Porkbun domain to create the records automatically, or on amanualdomain to get the list to enter by hand (nothing is changed; every outcome ismanual). - Needs
- an admin key with
project_id, or a project key with scopewrite(its own project; the argument is ignored), the domain’s id, and, for Porkbun, credentials on the node or the project. Noconfirmis needed: re-running converges,_dmarcand records Postwind does not own are never overwritten, and nothing is deleted. A provider failure is that record’soutcome, not an error; the firstunavailablerecord stops the run and the call ends within 30 s, so run it again for whatever is notcreated,updatedorunchanged. Until the node has a TLS client, a Porkbun domain answersprecondition_failed. - Returns
dns_providerandrecords(each withpurpose,type,name,content,outcomeanddetail); the same asPOST /api/v1/projects/{project_id}/domains/{domain_id}/dns/apply.
Arguments
- object
-
domain_idstring · uuidrequiredThe domain’s id, as
add_sending_domainorlist_sending_domainsgave it. -
project_idstring · uuid | nullThe domain’s project. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
dns_providerDnsProviderOutputWho applied the records:
porkbun, ormanual(nothing changed).porkbunPorkbun’s API.manualNobody: the records are for entry by hand. -
recordsarray of AppliedDnsRecordOne entry per required record, in the order they are created.
6 fields
- AppliedDnsRecord object · all fields required
-
contentstringThe value the record should hold.
-
detailstring | nullA message for
conflict,provider_errorandunavailable;nullotherwise. -
namestringThe owner name, without a trailing dot.
-
outcomeDnsApplyOutcomeOutputWhat
apply_dns_recordsdid to one record.- created
- updated
- unchanged
- skipped_exists
- manual
- conflict
- provider_error
- unavailable
-
purposeRecordPurposeOutputWhat a required record is for.
spf_bounceSPF of the bounce subdomain.mx_bounceMX of the bounce subdomain.dkimThe DKIM public key.dmarcThe DMARC policy.tracking_cnameThe tracking host’s CNAME. -
typeRecordTypeOutputThe type of a DNS record.
- txt
- mx
- cname
Definitions
AppliedDnsRecord
One required record and what apply_dns_records did to it.
- object · all fields required
-
contentstringThe value the record should hold.
-
detailstring | nullA message for
conflict,provider_errorandunavailable;nullotherwise. -
namestringThe owner name, without a trailing dot.
-
outcomeDnsApplyOutcomeOutputWhat
apply_dns_recordsdid to one record.- created
- updated
- unchanged
- skipped_exists
- manual
- conflict
- provider_error
- unavailable
-
purposeRecordPurposeOutputWhat a required record is for.
spf_bounceSPF of the bounce subdomain.mx_bounceMX of the bounce subdomain.dkimThe DKIM public key.dmarcThe DMARC policy.tracking_cnameThe tracking host’s CNAME. -
typeRecordTypeOutputThe type of a DNS record.
- txt
- mx
- cname
DnsApplyOutcomeOutput
What apply_dns_records did to one record.
string · enum
- created
- updated
- unchanged
- skipped_exists
- manual
- conflict
- provider_error
- unavailable
DnsProviderOutput
Who applies a domain’s DNS records.
string · enum
porkbun Porkbun’s API.
manual Nobody: the records are for entry by hand.
RecordPurposeOutput
What a required record is for.
string · enum
spf_bounce SPF of the bounce subdomain.
mx_bounce MX of the bounce subdomain.
dkim The DKIM public key.
dmarc The DMARC policy.
tracking_cname The tracking host’s CNAME.
RecordTypeOutput
The type of a DNS record.
string · enum
- txt
- mx
- cname
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: POST /api/v1/projects/{project_id}/domains/{domain_id}/dns/apply