DMARC, SPF and DKIM for Gandi
Updated 2026-12-04
Gandi is a domain registrar that also sells mailboxes with its domains, called Gandi Mail (Gandi's pages also write GandiMail). Gandi says Gandi Mail cannot be used with a domain not registered with Gandi. The DNS records usually live in Gandi LiveDNS, the nameservers Gandi provides for free. This guide follows Gandi's own documentation and covers mail you send from Gandi mailboxes, plus the Gandi Web Hosting include for sites that send mail. For background, see SPF explained, DKIM explained and DMARC explained.
What Gandi sends from
The visible From address is your own domain, for example [email protected]. You send through Gandi's mail server: Gandi's connection settings give mail.gandi.net as the outgoing (SMTP) server, with SMTP authentication using the same settings as the IMAP or POP account. The webmail interfaces are SOGo and Roundcube.
Gandi's pages do not say which domain Gandi Mail puts in the envelope sender (Return-Path), and they do not show a sample DKIM-Signature header with its d= tag. Our reading is that DKIM signs with your domain, because the DKIM records sit under your domain's _domainkey names. Do not rely on that: send a test mail and read the headers yourself (see "How to check it").
Where you add the records depends on the nameservers. On Gandi LiveDNS you open Domain, click the domain and select the DNS Records tab. There you can work in table mode (the green Add button, the green pencil to edit) or in text mode, where you edit the whole zone file after clicking Edit DNS Records. If you use an external nameserver, Gandi says you manage the records through that provider's interface.
SPF
As of December 2026 Gandi's article "What Are SPF Records?" gives this record for Gandi Mail:
yourdomain.com TXT v=spf1 include:_mailcust.gandi.net ~all
In Gandi's zone file notation that is @ 10800 IN TXT "v=spf1 include:_mailcust.gandi.net ~all", where @ is the bare domain and 10800 is the TTL in seconds. Gandi says to use a TXT record, not the deprecated SPF record type.
If a site on Gandi Web Hosting sends mail too, for example from a contact form, Gandi gives a combined record:
yourdomain.com TXT v=spf1 include:_mailcust.gandi.net include:_spf.gpaas.net ~all
The first record uses 1 DNS lookup in the record itself, the second 2. Gandi does not say how many lookups _mailcust.gandi.net or _spf.gpaas.net use inside, so run the SPF lookup counter on your domain to count the whole tree. RFC 7208 allows 10 lookups for the entire evaluation (too many SPF lookups).
~all, not ?all. Gandi's anti-spoofing page shows the same includes ending in ?all, which in RFC 7208 is "neutral": the domain is "not asserting whether the IP address is authorized". Gandi's own troubleshooting page for sending problems says to check "that you use ~all and not ?all", because Gmail prefers a stricter action. Use ~all. Our advice, not Gandi's, is also to avoid -all: RFC 9989 warns that -all can get a message rejected early in the SMTP transaction, before DMARC runs, even if aligned DKIM would have passed it.
One record only. RFC 7208 says a domain must not have multiple SPF records. If you also send through another service, add its include to the same record instead of publishing a second one (multiple SPF records).
DKIM
Gandi says email sent via its mail servers supports DKIM signatures. How you turn it on depends on the DNS.
On Gandi LiveDNS. If the domain and the mail are hosted by Gandi and the domain uses LiveDNS, you activate DKIM in your account: Domain, the domain name, the Email tab, Edit next to Settings & Security, switch the DKIM Signature toggle, then Update. Gandi's page does not say which records the toggle creates.
On other nameservers. If the domain and the mail are at Gandi but the domain uses a nameserver not provided by Gandi, you add three CNAME records yourself. As of December 2026 they are:
gm1._domainkey.yourdomain.com CNAME gm1.gandimail.net.
gm2._domainkey.yourdomain.com CNAME gm2.gandimail.net.
gm3._domainkey.yourdomain.com CNAME gm3.gandimail.net.
Gandi's own notation is gm1._domainkey 10800 IN CNAME gm1.gandimail.net. and so on. Gandi says all three CNAME records are needed in case of key rollover, so do not publish just one. Our reading, not Gandi's: because they are CNAMEs to Gandi's hostnames, there is no long key to paste, and Gandi can rotate the key behind them.
Gandi's pages do not say which of the three selectors signs your mail at a given time. Check the s= tag in a test mail's DKIM-Signature header, or enter gm1, gm2 and gm3 in the DKIM selector finder. If the check cannot find a key, see DKIM not found.
DMARC alignment
DMARC passes when SPF or DKIM passes and the passing domain aligns with the From domain. Two different domains are compared with the From domain. For SPF it is the envelope sender domain (the SMTP MAIL FROM, which receivers show as Return-Path), because SPF checks that domain. For DKIM it is the d= domain of a valid signature. RFC 9989 defines two alignment modes. Relaxed alignment needs the same organizational domain, so mail.yourdomain.com aligns with yourdomain.com. Strict alignment needs the identical domain. The aspf and adkim tags set the mode, and the default for both is relaxed (r).
Gandi's anti-spoofing page describes the three policies: none (no action, but you still receive reports), quarantine (treated as suspicious, for example placed in a spam folder) and reject (rejected and not delivered). It does not describe alignment modes or say whether Gandi Mail aligns on SPF, DKIM or both.
Our reading: the DKIM records sit under your own domain, so the DKIM signature is the path most likely to align, and it survives forwarding better than SPF. Gandi's forwarding page notes that forwarded mail "may fail SPF checks", and its anti-spoofing page warns that with a reject policy "forwarded mail may not be delivered". Confirm alignment with a test mail and your aggregate reports before you tighten the policy, and remember any other service that sends as your domain.
Step by step to p=reject
- Use Gandi's mail servers. Check that the domain has Gandi's MX records. Gandi's examples are
spool.mail.gandi.net.with priority 10 andfb.mail.gandi.net.with priority 50; Gandi adds them to the default zone when you register a domain. - Publish SPF. Add the TXT record
v=spf1 include:_mailcust.gandi.net ~allon@, or add the include to your existing SPF record. Addinclude:_spf.gpaas.netonly if a Gandi Web Hosting site sends mail. Keep one SPF record. - Turn on DKIM. On LiveDNS switch the DKIM Signature toggle under the Email tab, Settings & Security. On other nameservers add the three CNAME records for
gm1,gm2andgm3. - Publish DMARC with p=none and reports. Add a TXT record on
_dmarcwith a mailbox that receives reports. Delivery does not change; receivers start sending aggregate reports. - Read the reports and fix other senders. For a few weeks, check that Gandi Mail passes with an aligned domain, and give every other legitimate sender its own aligned DKIM.
- Move to p=quarantine. Change the policy and keep reading reports, because a sender you missed now lands in spam.
- Move to p=reject. When nothing legitimate fails, change the policy to
p=reject.
The record for step 4:
_dmarc.yourdomain.com TXT v=DMARC1; p=none; rua=mailto:[email protected]
It triggers our DMARC policy none note on purpose. The final record:
_dmarc.yourdomain.com TXT v=DMARC1; p=reject; rua=mailto:[email protected]
Gandi's example record starts at p=reject. Do not skip p=none and p=quarantine: the reports are how you find senders you forgot. Some receivers support pct (RFC 7489) or t=y (RFC 9989), but RFC 7489 says unknown tags must be ignored, so a receiver that implements only RFC 7489 can treat p=reject; t=y as a full reject, and RFC 9989 removed pct. Neither is a safety net (partial pct).
Common mistakes
- Copying
?all. The anti-spoofing page ends its SPF examples in?all; Gandi's SPF article and troubleshooting page use~all. - Copying the DMARC example straight in. It starts at
p=rejectand uses the placeholder[email protected]. Build your record with the DMARC record generator. - A second SPF record. Merge includes into one record (multiple SPF records).
- Only one DKIM CNAME. On external DNS publish all three,
gm1,gm2andgm3, or a key rollover can break signing. - Mixing the two DKIM paths. Gandi describes the DKIM Signature toggle for LiveDNS and the manual CNAMEs for nameservers not provided by Gandi. Our advice, not Gandi's: on LiveDNS use the toggle rather than adding the CNAMEs by hand.
- No report address. Without
ruayou cannot see what fails (DMARC without rua). - Expecting instant results. Gandi says DNS changes can take up to 72 hours to take effect. The minimum TTL on LiveDNS is 300 seconds; Gandi's examples use 10800.
- Sending from a forwarding address. Gandi warns that some servers treat mail sent "from" a forwarding address as spoofed; use a real mailbox or an alias.
How to check it
Run the email security check on yourdomain.com. Count the full SPF tree with the SPF lookup counter. Enter gm1, gm2 and gm3 in the DKIM selector finder. Then send a test mail from your Gandi mailbox to a mailbox you control and open the full headers. In SOGo webmail Gandi says to click the email, click the three dots at the upper right and choose View Message Source. Read the Return-Path, the d= and s= in DKIM-Signature, and the Authentication-Results line.
Frequently asked questions
What is the SPF record for Gandi Mail?
As of December 2026 Gandi's SPF article gives a TXT record on @ with the value v=spf1 include:_mailcust.gandi.net ~all. If a site on Gandi Web Hosting also sends mail, Gandi's combined value is v=spf1 include:_mailcust.gandi.net include:_spf.gpaas.net ~all. Gandi's anti-spoofing page shows the same includes ending in ?all, but its troubleshooting page says to use ~all and not ?all, so use ~all.
How do I turn on DKIM for Gandi Mail?
If the domain and the mail are at Gandi and the domain uses Gandi LiveDNS, open Domain, pick the domain, open the Email tab, click Edit next to Settings & Security, switch the DKIM Signature toggle and click Update. If the mail is at Gandi but the DNS is elsewhere, add three CNAME records yourself: gm1._domainkey, gm2._domainkey and gm3._domainkey, pointing to gm1.gandimail.net., gm2.gandimail.net. and gm3.gandimail.net.. Gandi says all three are needed in case of key rollover.
Should I copy Gandi's DMARC example as it is?
Not as your first record. Gandi's example is v=DMARC1; p=reject; rua=mailto:[email protected], which goes straight to reject. Gandi itself warns that a reject policy can stop forwarded mail from being delivered. Start with p=none and your own report address, read the reports, then move to quarantine and reject.
Can I use Gandi Mail with a domain registered elsewhere?
No. Gandi's email FAQ says Gandi Mail cannot be used with a domain not registered with Gandi. The DNS can still be hosted elsewhere: Gandi describes the manual DKIM records for domains that use a nameserver not provided by Gandi.
Sources
- How To Protect Your Email Against Being Spoofed, Gandi Documentation, fetched 2026-12-04.
- What Are SPF Records?, Gandi Documentation, fetched 2026-12-04.
- Why can't I send email?, Gandi Documentation, fetched 2026-12-04.
- How do I Update My DNS Records?, Gandi Documentation, fetched 2026-12-04.
- Common Questions about DNS Records, Gandi Documentation, fetched 2026-12-04.
- What Are MX Records?, Gandi Documentation, fetched 2026-12-04.
- How to Set Up Your Email Client to Work with Email Hosted by Gandi, Gandi Documentation, fetched 2026-12-04.
- How Do I Use Email at Gandi?, Gandi Documentation, fetched 2026-12-04.
- How to Forward Email or Create an Alias Email Address, Gandi Documentation, fetched 2026-12-04.
- How to View the Mail Headers of an Email in SOGo Webmail, Gandi Documentation, fetched 2026-12-04.
- RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1, RFC Editor, fetched 2026-12-04.
- RFC 9989: Domain-Based Message Authentication, Reporting, and Conformance (DMARC), RFC Editor, fetched 2026-12-04.
- RFC 7489: Domain-based Message Authentication, Reporting, and Conformance (DMARC), RFC Editor, fetched 2026-12-04.