I’ve written a script to set up a number of email settings for Fastmail, setting MX, A, CNAME, TXT and SRV records. They all work, except the SRV record.
I’ve checked how I can create a DNS record via the Cloudflare API (which works for the other types). I’ve copied the values from the Fastmail setup.
This is what I send to the Cloudflare API to create an SRV record:
- imap record
{
"Type":"SRV",
"Name":"_imap._tcp.kenbonny.net",
"Content":"0 0 0 .",
"Ttl":1,
"Priority":null,
"Proxied":false
}
- imap secure record
{
"Type":"SRV",
"Name":"_imaps._tcp.kenbonny.net",
"Content":"0 1 993 imap.fastmail.com",
"Ttl":1,"Priority":null,
"Proxied":false
}
And this is what I get back (identical in both cases):
{ Result = null
Success = false
Errors = [{ Code = 1004
Message = "DNS Validation Error"
Error_Chain = [{ Code = 9101
Message = "service is a required data field."
Error_Chain = null }] }] }
The result is deserialized json, while I pasted the actual json I send over the wire so you can see what I’m actually sending and not the pre-serialized printout.
It complains that the service is a required data field, but according to this Cloudflare explanation the service is encapsulated in the domain (_imap._tcp.kenbonny.net). I have tried sending it with and without a . (dot) at the end of the domain.
So I’m confused why this does not work.