Today I use DigitalOcean as hosting my software.

Our platform is a SaaS that sends emails from wildcard domains, example: [email protected]; [email protected];

Email services like Gmail, Outlook, etc, require SPF Records for subdomains, to avoid spoofing problems. The problem is that DigitalOcean does not allow a wildcard TXT record (*.example.com), and creating a subdomain for each account is not viable, as there are thousands of subdomains.

Is there a way to create a DNS record that can work around DigitalOcean's limitation?

There are more than thousands of subdomains used to send email, and it is impossible to create one by one. And also update all in batch.

  • 1
    Why not just send from an email address of [email protected]. One SPF record, many addresses.
    – ceejayoz
    Apr 7, 2020 at 19:50
  • @ceejayoz I use the subdomain so that my email server can identify which company the email is being replied to.
    – Tom
    Apr 7, 2020 at 20:45
  • I'm suggesting the username for that. Unless you've got a scenario where you need [email protected], like for a ticketing system or something.
    – ceejayoz
    Apr 8, 2020 at 1:48

1 Answer 1


The documentation on DigitalOcean's DNS records doesn't really mention whether wildcards are allowed with CNAME records or not, but that could be an option to circumvent the issue you are facing. E.g.

*.example.com.            IN  CNAME  saas-mailer.example.com.
saas-mailer.example.com.  IN  A
saas-mailer.example.com.  IN  TXT    "v=spf1 +ip4: -all"
  • Today I have an A record for this wildcard, this record redirects the client to the HTTP server. Wouldn't using an additional CNAME generate an access error? *.example.com IN A XXX.XXX.XXX.XXX
    – Tom
    Apr 7, 2020 at 20:50
  • The setup initially worked. But Google tools don't accept it, for the following reason: Naked domain must be an A record (not CNAME).
    – Tom
    Apr 8, 2020 at 1:50
  • The naked domain is example.com., which can't have a CNAME for obvious reasons (replacing all NS, SOA etc.).. This is about all subdomains *.example.com.. Apr 8, 2020 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .