Article ID: 11152, created on Mar 22, 2011, last review on Aug 16, 2016

  • Applies to:
  • Plesk for Linux/Unix


How to check whether a domain has a correctly set SPF record?


  1. The most simple solution is to use online tools like the following below:

  2. To test it manually using command line follow to steps below:

    Try to query with a command provided by libspf2 library like as below:

    /usr/bin/spfquery_static -ip -sender -rcpt-to

    A correctly set domain will print like this (using Google as an example):

    $ /usr/bin/spfquery_static -ip -sender -rcpt-to
    spfquery: domain of designates as permitted sender
    Received-SPF: pass (spfquery: domain of designates as permitted sender) client-ip=;;

    A problematic domain looks more like this:

        $ /usr/bin/spfquery_static -ip -sender -rcpt-to
        Context: Failed to query MAIL-FROM
        ErrorCode: (26) DNS lookup failure
        Error: Temporary DNS failure for ''.
        Please see : Reason: default
        spfquery: is neither permitted nor denied by domain of
        Received-SPF: neutral (spfquery: is neither permitted nor denied by domain of client-ip=;;

    To check that DNS server has information about SPF for domain, use the dig utility:

    # dig -t TXT +short @
    "v=spf1 +a +mx -all +a:server.hostname.tld"

    , where IP address of the server.hostname.tld where DNS server is running.


Note that the SPF information can be written in either TXT format or as a dedicated SPF record. The latter is also sometimes referred to as a "type99" record. The SPF information needs to be in at least one of these formats. If both are used, these records must be exact copies of each other. These records are served by the same DNS server that serves domain name.

Library libspf2 performs an SPF check in the following order: - First, it queries the DNS server for an SPF record. - If it is not defined, it tries to query for TXT. - If both attempts fail, it means there is no SPF for this domain.

For more information check Plesk Documentation and Help Portal - Sender Policy Framework System (Linux)

Search Words

<>: Recipient address rejected: Message rejected due to: SPF

qmail mail not delivered dns fail

mail go to spam

emils sent as spam

error 554

29d1e90fd304f01e6420fbe60f66f838 a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF