---
title: "Validate domain SPF records"
method: GET
path: "/validate_current_spfs"
tags: ["Mail", "Mail DNS Settings"]
---

# Validate domain SPF records

`GET /validate_current_spfs`

This function validates a Sender Policy Framework (SPF) record for one or more domains.

## Query parameters

- `domain` string, domain, required

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `payload` object[] — An array of objects containing information about a domain's SPF records.
      - `domain` string, domain — The queried domain.
      - `error` string — An error message that details the reason why the DNS lookup failed. **Note:** The function **only** returns this value when the `state` return is the `ERROR` value.
      - `expected` string — The SPF record for the domain in the DNS.
      - `ip_address` union — The domain's IPv4 or IPv6 address.
        - string, ipv4
        - string, ipv6
      - `ip_version` 4 | 6 — The IP address version. * `4` — IPv4. * `6` — IPv6.
      - `records` object[] — The SPF records of the domain's DNS.
        - `current` string — The SPF record's contents.
        - `reason` string — The reason for the SPF record's status.
        - `state` 'PASS' | 'NEUTRAL' | 'FAIL' | 'SOFTFAIL' | 'TEMPERROR' | 'PERMERROR' — The SPF record's status. * `PASS` — The SPF record confirms that the `ip_address` value is a valid sender. * `NEUTRAL` — The current SPF record configuration does not determine the `ip_address` value's validity. * `FAIL` — The SPF record states that the `ip_address` value is **not** a valid sender. * `SOFTFAIL` — The SPF record states that the `ip_address` value is **not** a valid sender, but does not `FAIL` state it. * `TEMPERROR` — The SPF record check resulted in a failure. For example, a network failure. * `PERMERROR` — The domain's SPF records are **incorrect** and require manual correction. **Note:** These values correspond with [RFC 7208 section 2.6](https://tools.ietf.org/html/rfc7208#section-2.6).
      - `state` 'VALID' | 'MISMATCHED' | 'MULTIPLE' | 'MISSING' | 'ERROR' — The SPF record's status. * `VALID` — A single `SPF TXT` record exists in the domain's DNS with the correct `ip_address` value or redirect mechanism. * `MISMATCHED` — An `SPF TXT` record exists for the domain that does **not** match the `ip_address` value. * `MULTIPLE` — Multiple `SPF TXT` records exist in the domain's DNS. * `MISSING` — No `SPF TXT` record exists for the domain's DNS. * `ERROR` — The record's DNS lookup failed. The system returns the reason in the `error` return.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 1 | 0 — * `1` — Success. * `0` — Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
