New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
Free tool

SPF record generator

Choose your senders and policy. Copy the finished TXT record into your DNS, then test it with the checker.

  • Runs in your browser
  • Counts lookups as you build
  • Copy-ready TXT record

Your senders

Policy for everything else

Your SPF record

Type
TXT
Host
@ (the root of your domain)

    Test this record

    The generator builds text only. It does not change your DNS and it cannot know which services send on your behalf, so list every sender before you publish. Confirm provider include values against the provider's own documentation.

    Before you build a record

    List every system that sends email using your domain: your mailbox provider, your sending service, and anything else that sends on your behalf, such as a CRM, billing system or helpdesk. Marketing tools and website forms are the ones people forget. If a system is missing from the record, its mail can fail SPF.

    Check whether your domain already has a record. Publishing a second one does not add to the first; a domain with two SPF records gets an error. Use the checker on your domain first and build the new record to replace the old one.

    Choosing the senders

    The generator offers the common cases and lets you add the rest.

    • Mailbox providers: tick Google Workspace or Microsoft 365 if your staff send from them.
    • Your sending service: paste the SPF include value that your provider tells you to use. Providers publish this in their setup instructions; we do not guess it for you.
    • Other services: one include domain per line, again exactly as the provider documents it.
    • Your own servers: IPv4 or IPv6 addresses or ranges. These cost no DNS lookups, so prefer them when a provider offers fixed addresses.
    • MX and A: add mx or a only if mail really leaves from the servers your domain's MX or website records point to.

    Pick the ending carefully

    The last term tells receivers what to do with mail from servers you did not list.

    EndingMeaningWhen to use it
    ~allSoft fail: not authorised, but do not reject on SPF alone.A sensible default while you confirm your list of senders.
    -allHard fail: not authorised.When you are sure the list is complete.
    ?allNeutral: no opinion.Rarely useful. It gives receivers nothing to act on.

    Publish it

    Create a TXT record at the root of your domain (the host is usually shown as @). Paste the record exactly as generated, without extra quotation marks unless your DNS panel asks for them. If your panel splits long values for you, let it. Keep the time-to-live low, such as 300 seconds, while you test.

    Changes are not instant. Resolvers cache the old answer until its time-to-live runs out, so allow time, then check the live record with our SPF checker. The "Test this record" button opens the checker with your generated record already loaded, before you publish it.

    The generator keeps count of DNS lookups as you add services. If you go over ten, remove something or move a sender to its own subdomain. A record that is over the limit looks fine and still fails.

    After you publish

    SPF is one of three checks. Add DKIM signing for your sending service, then a DMARC record so receivers know what to do when a message fails. Start DMARC at p=none, read the reports for a few weeks, and only then tighten it. Our DMARC generator builds the record and shows a safe rollout.

    How to use the generator

    1. 1

      Add your senders

      Tick the services you use, paste any include values from other providers, and list your own server addresses.

    2. 2

      Pick a policy

      ~all is the usual starting point. Move to -all when you are sure every sender is listed.

    3. 3

      Copy the record

      Publish it as a single TXT record at the root of your domain. Replace any existing SPF record instead of adding a second one.

    4. 4

      Test it

      Use the checker to see the real lookup count, because every provider include uses lookups of its own.

    Frequently asked questions

    How do I create an SPF record?

    List every system that sends email as your domain, add one include or ip4/ip6 entry for each, and end the record with ~all. Publish the result as a single TXT record at the root of your domain. This generator builds the text for you.

    Should I end my SPF record with ~all or -all?

    Most teams start with ~all (soft fail) while they confirm that every sender is listed, and consider -all (hard fail) once they are sure. DMARC with DKIM gives additional protection whichever you choose.

    Can a domain have more than one SPF record?

    No. A domain must publish exactly one SPF record. Two records cause a permanent error. If you add a new sender, add its include to the existing record instead of creating a second one.

    Where do I find the include value for my sending service?

    Each provider documents its own value. For MigoSMTP, copy the SPF value shown in your dashboard. For Google Workspace and Microsoft 365 the generator offers the values from their public documentation; confirm them against the provider's current help page before you publish.

    How many includes can I add?

    As many as fit within the limit of ten DNS lookups for the whole record, counting the lookups inside each provider's own record. Publish the record, then run the SPF record checker to see the real total.

    How long does it take for an SPF change to take effect?

    It depends on the TTL of the record. Many DNS providers use values from a few minutes to a few hours, and some resolvers cache longer. After you publish, check again with the checker and wait for the old value to expire.

    Check your record after you publish it

    Run the checker to confirm the record is valid and to see how many of the ten lookups it uses.

    Open the SPF checker

    Start sending in minutes.

    Create an account, add your domain and send your first email.

    Start free Talk to sales