Guides
Domains & DNS
Add a sending domain and publish its DKIM, return-path (MX + SPF) and DMARC records. How verification works and how to fix the usual DNS problems.
Pidgely sends only from domains you have verified. Verification proves you control the domain and, more importantly, sets up the authentication that mailbox providers check before they trust your mail: DKIM, an SPF-aligned return path and DMARC.
Configure DNS automatically
In the dashboard, add the domain (only its name is needed) and open it. Pidgely looks up who hosts your DNS and offers the quickest way to publish the records:
- Connect with your provider (Domain Connect). When your DNS provider supports Domain Connect, click Connect with ‹provider›, sign in there and approve. The provider adds exactly Pidgely's records and sends you back; verification starts on its own, usually within a minute. The link is signed by Pidgely and can only add this domain's records.
- Connect with Cloudflare. For domains on Cloudflare, click Connect with Cloudflare, create an API token from the prefilled link (permissions Zone → DNS → Edit and Zone → Zone → Read; under Zone Resources pick your domain), and paste it. Pidgely creates or updates only its own records, merges its
include:into an SPF record that already exists (it never adds a second SPF record), and keeps an existing DMARC policy. Running it again changes nothing. The token is used for that single request and is never stored. You can delete it at Cloudflare afterwards. - Configure manually. For any other provider, copy the records below from the dashboard (every value has a copy button, or download a zone file).
The same setup works with a full_access API key (scripts, the Node.js SDK and the MCP server). Detect the provider first:
import { Pidgely } from 'pidgely';
const pidgely = new Pidgely(process.env.PIDGELY_API_KEY);
const { data, error } = await pidgely.domains.dnsProvider('0199d7f0-1c2b-7e4d-a5f6-0b9c8d7e6f51');
console.log(data ?? error);curl -X GET 'https://api.pidgely.com/domains/0199d7f0-1c2b-7e4d-a5f6-0b9c8d7e6f51/dns-provider' \
-H "Authorization: Bearer $PIDGELY_API_KEY"When cloudflare is true, pass a Cloudflare API token. It is write-only: used for that request, never stored, logged or returned.
import { Pidgely } from 'pidgely';
const pidgely = new Pidgely(process.env.PIDGELY_API_KEY);
const { data, error } = await pidgely.domains.setupCloudflare('0199d7f0-1c2b-7e4d-a5f6-0b9c8d7e6f51', {
apiToken: 'your-cloudflare-api-token',
});
console.log(data ?? error);curl -X POST 'https://api.pidgely.com/domains/0199d7f0-1c2b-7e4d-a5f6-0b9c8d7e6f51/dns-provider/cloudflare' \
-H "Authorization: Bearer $PIDGELY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"api_token": "your-cloudflare-api-token"
}'When domain_connect is set instead, open its url in a browser to approve the records at your provider.
The DNS guide on the domain screen
While a domain is not verified (and for DMARC afterwards, if you have none), the domain page shows What is left to fix, one card per record that matters, using the same per-record status that records[] returns in the API:
| Card | What it checks | Where it lives |
|---|---|---|
| DKIM | the signing key | pdg…._domainkey |
| Return path (MX) | bounces come back to Pidgely | bounces |
| Return path (SPF) | Pidgely may send for the domain | bounces |
| DMARC | policy and reports (recommended) | _dmarc |
Each card says what we found (Found and correct, Missing or different, Changed or removed when it used to pass, Could not be read when the lookup timed out), and for anything not passing it gives a 3-step recipe with the exact type, host and value (every field has a copy button), a dig command that shows what the world sees, and the mistakes that cause that record to fail: a duplicated domain in the host, a cut or altered DKIM value, a CNAME on the same name as the MX, two SPF records. The records update on their own; press Verify now after each change.
DMARC: a suggestion, never an overwrite
If the domain has no DMARC, the DMARC card suggests a monitoring-only record: v=DMARC1; p=none; rua=mailto:dmarc@acme.com. p=none blocks nothing; the rua address receives the daily aggregate reports, so use one you read (type another and the record updates). When the address is on a different domain, the card also shows the TXT that domain must publish at acme.com._report._dmarc.<report-domain> so receivers deliver the reports.
If a DMARC record already exists, Pidgely does not replace or edit it: the card says so and shows nothing to paste. The Cloudflare and Domain Connect setups follow the same rule. A name can have only one DMARC record, so if you have one, edit it (add rua=mailto:…) instead of adding another.
Add a domain
import { Pidgely } from 'pidgely';
const pidgely = new Pidgely(process.env.PIDGELY_API_KEY);
const { data, error } = await pidgely.domains.create({
name: 'acme.com',
});
console.log(data ?? error);import os
import pidgely
pidgely.api_key = os.environ["PIDGELY_API_KEY"]
result = pidgely.Domains.create({
"name": "acme.com",
})
print(result)<?php
require __DIR__ . '/vendor/autoload.php';
$pidgely = Pidgely::client(getenv('PIDGELY_API_KEY'));
$result = $pidgely->domains->create([
'name' => 'acme.com',
]);
var_dump($result);package main
import (
"context"
"fmt"
"os"
"github.com/pidgely/pidgely-go"
)
func main() {
ctx := context.Background()
client := pidgely.NewClient(os.Getenv("PIDGELY_API_KEY"))
result, err := client.Domains.Create(ctx, &pidgely.CreateDomainRequest{
Name: "acme.com",
})
if err != nil {
panic(err)
}
fmt.Println(result)
}require "pidgely"
Pidgely.api_key = ENV["PIDGELY_API_KEY"]
result = Pidgely::Domains.create({
name: "acme.com"
})
puts resultcurl -X POST 'https://api.pidgely.com/domains' \
-H "Authorization: Bearer $PIDGELY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"name": "acme.com"
}'The response (Create a domain) includes the records to publish. Names are relative to your domain:
| Purpose | Type | Name | Value |
|---|---|---|---|
| DKIM | TXT |
pdg202610._domainkey |
v=DKIM1; k=rsa; p=MIIBIjANBg… (RSA-2048 public key) |
| Return path | MX |
bounces |
mta.pidgely.com, priority 10 |
| SPF | TXT |
bounces |
v=spf1 include:_spf.mta.pidgely.com ~all |
| DMARC (recommended) | TXT |
_dmarc |
v=DMARC1; p=none; |
Always copy the exact values from the API response or the dashboard: the DKIM selector (pdg plus the year and month the domain was added) and the key are unique to your domain.
Why these records
- DKIM signs every message with a key only Pidgely holds; receivers fetch the public key from
pdg…._domainkey.acme.com. Pidgely signs with relaxed/relaxed canonicalization and oversigns From, Subject and To. - Return path. Bounces go to
bounces.acme.com(the envelope sender, with a per-message VERP address). TheMXroutes bounces back to Pidgely so they are processed automatically, and the SPF record authorizes Pidgely's servers for that subdomain. Because it is a subdomain of yours, SPF aligns with your From domain for DMARC. - DMARC tells receivers what to do when authentication fails and where to send reports. Start with
p=none, watch the reports, then move toquarantineorreject. Pidgely does not require DMARC to send, but Gmail and Yahoo require it for bulk senders.
Read more in SPF, DKIM and DMARC explained. Portuguese speakers: Verificar domínio, SPF, DKIM e DMARC passo a passo walks through Cloudflare, Registro.br and GoDaddy, with examples, how to check and common errors.
Options
| Field | Description |
|---|---|
custom_return_path |
Label of the return-path subdomain, default bounces. One DNS label: lowercase letters, digits and hyphens (^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$). |
tls |
opportunistic (default): use TLS whenever the receiving server offers it. enforced: deliver only over TLS, otherwise retry and eventually fail. Change it later with Update a domain. |
open_tracking, click_tracking |
Open and click tracking of emails sent from the domain. Both false by default. |
tracking_subdomain |
Optional custom tracking host (Pidgely extension): links makes tracked links use links.acme.com. Adds a Tracking record, CNAME links → t.pidgely.com, checked with the others but never required. |
They have defaults that suit almost everyone, so the dashboard asks only for the domain name and keeps them under Advanced settings on the domain page. Update a domain accepts custom_return_path too, as long as the domain is not verified yet (the MX and SPF records move to the new label); the return path of a verified domain is fixed.
region is informative, and receiving is not supported yet: capabilities.receiving: "enabled" is rejected. tracking_host reports the host tracked links use right now.
Verification
After publishing the records, call Verify a domain or wait: the first check runs in the background about a minute after the domain is added, new domains are re-checked every 5 minutes during their first 3 days, and every domain is re-checked daily afterwards. The dashboard also checks every few seconds while the domain page is open. Adding a domain never waits for DNS: it returns at once.
| Status | Meaning |
|---|---|
not_started |
The domain was added but never checked. |
pending |
Checked, but some required records are missing or wrong. DNS can take minutes (rarely hours) to propagate. |
verified |
DKIM, the return-path MX and SPF all pass. You can send. |
failed |
Records that used to pass no longer do (DNS changed), or the domain stayed unverified for more than 72 hours when verification was requested. Fix the DNS and verify again. |
temporary_failure |
The last check could not read the records: the DNS lookups timed out or the name servers answered SERVFAIL, and nothing was found missing or wrong. Pidgely checks again every 5 minutes. A verified domain keeps sending meanwhile. |
Each record in records[] has its own status, so you can see exactly which one is missing. last_checked_at tells when the last check ran (null before the first one). Status changes emit a domain.updated webhook.
Rules
- Exact match. Mail from
news.acme.comneedsnews.acme.comadded as its own domain;acme.comdoesn't cover subdomains. - One account per domain. A domain can be verified by only one Pidgely account. Verifying a domain already verified elsewhere fails with
… is verified by another account. - Plan limits. Free allows 3 domains, Starter 10, Growth 25, Scale unlimited (plans). The sending quota is per account and shared by all of its domains. Adding more returns
403 validation_error. - Deleting a domain stops sending from it immediately; messages still queued for it are retried and eventually fail.
Troubleshooting
The record exists but Pidgely says it's missing. Many DNS providers append your domain automatically. If you entered pdg202610._domainkey.acme.com as the name, the provider may have created pdg202610._domainkey.acme.com.acme.com. Enter only the relative part (pdg202610._domainkey).
Check what the world sees with dig (or nslookup -type=TXT):
dig +short TXT pdg202610._domainkey.acme.com
dig +short MX bounces.acme.com
dig +short TXT bounces.acme.com
dig +short TXT _dmarc.acme.comDKIM value split or truncated. A 2048-bit key is longer than 255 characters. Most providers split long TXT values automatically; if yours asks for it, paste the value as several quoted strings in one record ("v=DKIM1; k=rsa; p=MIIB…" "…rest"). Make sure no quotes or spaces were added inside the key.
MX on bounces conflicts with a CNAME. A name can't have both. Remove the CNAME or choose another label with custom_return_path.
Two SPF records on the same name. If bounces.acme.com already had an SPF record, merge them into one: a name can have only one v=spf1 record. The Cloudflare and Domain Connect setups do this merge for you.
"Connect with Cloudflare" says the token is not accepted or cannot see the zone. Create the token from the button in the dialog (it presets the permissions), include your domain under Zone Resources, and paste the token right away: Cloudflare shows it only once.
The Domain Connect window was closed or canceled. Nothing was changed. Click Connect again, or use Configure manually.
Cloudflare and other proxies. MX and TXT records are never proxied, so no special setting is needed.
Still stuck? Contact support with the domain name; we can see which check fails.