Retrieving one or all existing SPF Records using the API requires specific syntax depending on whether you are using REST or SOAP. Use this table to find the syntax for your command.
See RFC 4408 for more information about SPF Records.
Understanding How The API Works »
REST Syntax
Click to view all REST Resources |
/REST/SPFRecord/ GET — Retrieve one or all existing SPF Records on the zone/node indicated.
HTTP Action — GET
URIs:
Get one SPF record — https://api.dynect.net/REST/SPFRecord/<zone>/<fqdn>/<record_id>/
Get all SPF records — https://api.dynect.net/REST/SPFRecord/<zone>/<fqdn>/ |
Arguments:
No Arguments. |
Response:
Get one SPF record — Click for More Info
- string
fqdn — Fully qualified domain name of a node in the zone.
- hash
rdata — RData defining the record(s) to replace.
- string
txtdata — Free text box containing SPF record information.
- string
record_type — The RR Type of the record.
- string
ttl — TTL for the record.
- string
zone — Name of the zone.
Get all SPF records: array — Individual SPF Record resources. |
SOAP Syntax
Click to view all SOAP Commands |
GETOneSPFRecord — Retrieve one existing SPF Record on the zone/node indicated.
GETSPFRecords — Retrieve all existing SPF Records on the zone/node indicated. |
Arguments:
GetOneSPFRecord — Click for More Info
- string
fqdn — Required. Fully qualified domain name of a node in the zone.
- string
record_id — A numeric identifier for the record.
- hash
rdata — RData defining the record.
- string
txtdata — Required. Free text box containing SPF record information.
Special characters ;, \, and ” must be escaped with a single \.
Example of a simple SPF record:
v=spfl mx ptr -all
- string
token — Required. The session identifier.
- string
zone — Required. Name of the zone.
GetSPFRecords — Click for More Info
string fqdn — Required. Name of node where the record exists.
string token — Required. The session identifier.
string zone — Required. Name of zone where the record exists.
|
Response:
GetOneSPFRecord — Click for More Info
- hash
data
- string
fqdn — Fully qualified domain name of a node in the zone.
- hash
rdata — RData defining the record.
- string
txtdata — Free text box containing SPF record information.
- string
record_id — A numeric identifier for the record.
- string
record_type — The RRType of the record.
- string
ttl — TTL for the record.
- string
zone — Name of the zone.
GetSPFRecords — Click for More Info
- array
data
- string
fqdn — Fully qualified domain name of a node in the zone.
- hash
rdata — RData defining the record.
- string
txtdata — Free text box containing SPF record information.
- string
record_id — A numeric identifier for the record.
- string
record_type — The RRType of the record.
- string
ttl — TTL for the record.
- string
zone — Name of the zone.
|
Example Request (GetOneSPFRecord) — Click for More Info
{
'fqdn' => 'somehost.example.com',
'rdata' => {
'txtdata' => 'v=spf1 +mx a:colo.example.com/28 -all',
},
'token' => 'asdlkfjasl23j4879afa',
'zone' => 'example.com',
}
or
{
'fqdn' => 'example.com',
'record_id' => '32',
'token' => 'asdlkfjasl23j4879afa',
'zone' => 'example.com',
}
|
Example Request (GetSPFRecords) — Click for More Info
{
'fqdn' => 'somehost.example.com',
'token' => 'asdlkfjasl23j4879afa',
'zone' => 'example.com',
}
|
DNS API Knowledge Base