Controller: DnsRecord

API Controller /nodeworx/dns/record
Required Permissions ["DNS"]
Action Description
add Add a DNS record. DEPRECATED in version 4.8.0-393
addA Add an A record to a zone.
addAAAA Add an AAAA record to a zone.
addCNAME Add a CNAME record to a zone.
addMX Add an MX record to a zone.
addNAPTR Add an NAPTR record to a zone.
addNS Add an NS record to a zone.
addPTR Add a PTR record to a zone.
addSOA Add an SOA record to a zone.
addSPF Add an SPF record to a zone.
addSRV Add an SRV record to a zone.
addTXT Add a TXT record to a zone.
delete Delete a DNS record.
edit Edit a DNS record. DEPRECATED in version 4.8.0-393
editA Edit an A record.
editAAAA Edit an AAAA record.
editCNAME Edit a CNAME record.
editMX Edit a MX record.
editNAPTR Edit a NAPTR record.
editNS Edit a NS record.
editPTR Edit a PTR record.
editSOA Edit an SOA record.
editSPF Edit an SPF record.
editSRV Edit an SRV record.
editTXT Edit a TXT record.
listRecordIds List dns records by id. DEPRECATED in version 4.1.0-247
listRecords List dns records by id.
queryRecords Query DNS Records.

Action: add

This action has been deprecated as of version 4.8.0-393.

MESSAGE: 2011-02-23 Use the individual add(record-type) functions instead.

Add a DNS record.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string Yes
type string
Example Values
A, CNAME, NS, MX, PTR, TXT, SOA, SPF, SRV, AAAA, NAPTR
Yes
target string Yes
ttl integer
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Yes

Action: addA (Added in version 4.8.0-393)

Add an A record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
ipaddress string
Help Entry
####
Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addAAAA (Added in version 4.8.0-393)

Add an AAAA record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
ipaddress string
Help Entry
####
Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addCNAME (Added in version 4.8.0-393)

Add a CNAME record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
alias string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addMX (Added in version 4.8.0-393)

Add an MX record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
preference integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records should be attempted. Lower numbers will be processed before higher ones.
Yes
mail_server string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addNAPTR (Added in version 4.8.0-393)

Add an NAPTR record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
domain string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
order integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records MUST be processed by a client. Lower numbers will be processed before higher ones. Once a client has matched a record, that client will stop looking for records with a higher Order.
Example Default Value
10
No*
preference integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records SHOULD be processed by a client. Lower numbers will be processed before higher ones. Once a client has matched a record, that client may consider records with a higher Preference. This is similar to the preference of an MX record.
Example Default Value
100
No*
flag string
Example Values
S, A, U, P
Yes
service string No
regex string No
replacement string
Help Entry
The next name to query for additional records. This must be a Fully Qualified Domain Name (FQDN).
No
* indicates that it's actually required, but probably already has a valid default value

Action: addNS (Added in version 4.8.0-393)

Add an NS record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
nameserver string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addPTR (Added in version 4.8.0-393)

Add a PTR record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
ip_data string
Help Entry
The IP Data for a PTR record can be entered in several formats.
  • Normal IPv4 - 1.2.3.4
  • Normal IPv6 - beef::12fe
  • Hostname - 4.3.2.1.in-addr.arpa
  • RFC4183-style - 4.3/29.2.1.in-addr.arpa
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
domain string
Example Default Value
dns-template.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: addSOA (Added in version 4.8.0-393)

Add an SOA record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
nameserver string
Help Entry
Enter the primary nameserver of your domain. This will almost always be handled automatically for you when creating SiteWorx accounts and you are urged to only alter this value if you know what you are doing. This nameserver is listed on your SOA record for this domain and setting it to an incorrect value could cause your site or any of your DNS records not to function properly.
Yes
email string
Help Entry
This is the e-mail address listed on your SOA record. Enter it as a normal e-mail address (user@domain.com) and not in the typical SOA style of (user.domain.com).
Yes
refresh integer
Description
In Seconds
Help Entry
Sets the number of seconds that a slave will cache the record before re-checking the primary server. Recommended values are between 1200 (twenty minutes) and 43200 (twelve hours).
Yes
retry integer
Description
In Seconds
Help Entry
Set the number of seconds to retry a refresh after the previous refresh attempt fails. Recommended values are between 180 (three minutes) and 900 (fifteen minutes).
Yes
expiration integer
Description
In Seconds
Help Entry
Set the number of seconds for refresh and retry attempts before the server will stop serving the zone. Per RFC 1912, recommended values are between 1209600 (two weeks) and 2419200 (four weeks). This value is only used by slave servers.
Yes
negative_ttl integer
Description
In Seconds
Help Entry
Time in seconds for negative answers (NXDOMAIN) from this zone. This field was redefined in 1998 by RFC2308. Suggested values are between 3600 (one hour) and 10800 (three hours). Values higher than 86400 (twenty-four hours) should be avoided.
Yes

Action: addSPF (Added in version 4.8.0-393)

Add an SPF record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
spf_record_value string
Example Default Value
v=spf1
No*
use_a integer
Description
Should the IP(s) referenced in DNS A Records for this domain be permitted to send mail?
Example Values
1, 0
Example Default Value
0
No*
use_mx integer
Description
Should the hostnames referenced in DNS MX Records for this domain be permitted to send mail?
Example Values
1, 0
Example Default Value
0
No*
use_ptr integer
Description
Should the PTR Records for the sender's IP be used to validate the sender's domain? NOT RECOMMENDED.
Example Values
1, 0
Example Default Value
0
No*
other_servers integer
Description
Do any other hostnames or IPs need to be authorized to send mail for this domain?
Example Values
1, 0
Example Default Value
0
No*
mechanism_a struct (string)
Description
If the domain name has an address record (A or AAAA) that can be resolved to the sender's address, it will match.
No
mechanism_mx struct (string)
Description
If the domain name has an MX record resolving to the sender's address, it will match (i.e. the mail comes from one of the domain's mail servers).
No
mechanism_ip4 struct (string)
Description
If the sender is in a given IPv4 range, match.
No
mechanism_ip6 struct (string)
Description
If the sender is in a given IPv6 range, match.
No
mechanism_ptr struct (string)
Description
If the domain name for the client's address is in the given domain and that domain name resolves to the client's address, match. Input may use macro-expansion. NOT RECOMMENDED.
No
mechanism_exists struct (string)
Description
If there is a valid A Record for the given domain, match. Input may use macro-expansion.
No
mechanism_include struct (string)
Description
Used to include the policies of another domain's SPF record. Similar to the 'Redirect' parameter.
No
all string
Description
Defines how to respond if the record has produced no match.
Example Values
, -all, ~all, ?all, +all
No
redirect string
Description
Redirects verification to use the SPF record of the specified domain. This is useful, for example, if you send mail through your ISP's servers and they have defined an SPF record.
No
explanation string
Description
Defines a DNS name whose TXT Record may be returned along with failure messages. Rarely used, may not be universally supported.
No
* indicates that it's actually required, but probably already has a valid default value

Action: addSRV (Added in version 4.8.0-393)

Add an SRV record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
service string
Help Entry
The symbolic name of the desired service. For example, _sip, _ldap, etc.
Yes
protocol string
Help Entry
The name of the protocol with an underscore prepended to avoid collisions with other DNS records. "_TCP" and "_UDP" are the two most common values.
Yes
domain string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
priority integer Yes
weight integer Yes
port integer Yes
target string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: addTXT (Added in version 4.8.0-393)

Add a TXT record to a zone.

Input Parameters

Name Type Notes Required?
zone_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
text string Yes
* indicates that it's actually required, but probably already has a valid default value

Action: delete

Delete a DNS record.

Input Parameters

Name Type Notes Required?
record_id struct (integer) Yes

Action: edit

This action has been deprecated as of version 4.8.0-393.

MESSAGE: 2011-02-23 Use the individual edit(record-type) functions instead.

Edit a DNS record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
dns-template.com
No*
type string
Example Values
A, CNAME, NS, MX, PTR, TXT, SOA, SPF, SRV, AAAA, NAPTR
Example Default Value
SOA
No*
target string
Example Default Value
ns1.dns-template.com admin@dns-template.com 7200 2048 1048576 21600
No*
ttl integer
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editA (Added in version 4.8.0-393)

Edit an A record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
ipaddress string
Help Entry
####
Example Default Value
1.1.1.1
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editAAAA (Added in version 4.8.0-393)

Edit an AAAA record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
example.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
ipaddress string
Help Entry
####
Example Default Value
BEAD:0000:0000:0000:0000:0000:0000:0001
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editCNAME (Added in version 4.8.0-393)

Edit a CNAME record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
www.dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
alias string
Example Default Value
dns-template.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editMX (Added in version 4.8.0-393)

Edit a MX record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
preference integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records should be attempted. Lower numbers will be processed before higher ones.
Example Default Value
10
No*
mail_server string
Example Default Value
mail.dns-template.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editNAPTR (Added in version 4.8.0-393)

Edit a NAPTR record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
domain string
Example Default Value
example.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
order integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records MUST be processed by a client. Lower numbers will be processed before higher ones. Once a client has matched a record, that client will stop looking for records with a higher Order.
Example Default Value
10
No*
preference integer
Help Entry
An integer, ranging from 0-65535, indicating the order in which records SHOULD be processed by a client. Lower numbers will be processed before higher ones. Once a client has matched a record, that client may consider records with a higher Preference. This is similar to the preference of an MX record.
Example Default Value
100
No*
flag string
Example Values
S, A, U, P
Example Default Value
S
No*
service string No
regex string
Example Default Value
!^.*$!sip:info@example.com!
No
replacement string
Help Entry
The next name to query for additional records. This must be a Fully Qualified Domain Name (FQDN).
Example Default Value
_sip._udp.example.com
No
* indicates that it's actually required, but probably already has a valid default value

Action: editNS (Added in version 4.8.0-393)

Edit a NS record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
dns-template.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
nameserver string
Example Default Value
ns1.interworx.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editPTR (Added in version 4.8.0-393)

Edit a PTR record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
ip_data string
Help Entry
The IP Data for a PTR record can be entered in several formats.
  • Normal IPv4 - 1.2.3.4
  • Normal IPv6 - beef::12fe
  • Hostname - 4.3.2.1.in-addr.arpa
  • RFC4183-style - 4.3/29.2.1.in-addr.arpa
Example Default Value
4.3.2.1.in-addr.arpa
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
domain string
Example Default Value
example.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editSOA (Added in version 4.8.0-393)

Edit an SOA record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
nameserver string
Help Entry
Enter the primary nameserver of your domain. This will almost always be handled automatically for you when creating SiteWorx accounts and you are urged to only alter this value if you know what you are doing. This nameserver is listed on your SOA record for this domain and setting it to an incorrect value could cause your site or any of your DNS records not to function properly.
Example Default Value
ns1.dns-template.com
No*
email string
Help Entry
This is the e-mail address listed on your SOA record. Enter it as a normal e-mail address (user@domain.com) and not in the typical SOA style of (user.domain.com).
Example Default Value
admin@dns-template.com
No*
refresh integer
Description
In Seconds
Help Entry
Sets the number of seconds that a slave will cache the record before re-checking the primary server. Recommended values are between 1200 (twenty minutes) and 43200 (twelve hours).
Example Default Value
7200
No*
retry integer
Description
In Seconds
Help Entry
Set the number of seconds to retry a refresh after the previous refresh attempt fails. Recommended values are between 180 (three minutes) and 900 (fifteen minutes).
Example Default Value
2048
No*
expiration integer
Description
In Seconds
Help Entry
Set the number of seconds for refresh and retry attempts before the server will stop serving the zone. Per RFC 1912, recommended values are between 1209600 (two weeks) and 2419200 (four weeks). This value is only used by slave servers.
Example Default Value
1048576
No*
negative_ttl integer
Description
In Seconds
Help Entry
Time in seconds for negative answers (NXDOMAIN) from this zone. This field was redefined in 1998 by RFC2308. Suggested values are between 3600 (one hour) and 10800 (three hours). Values higher than 86400 (twenty-four hours) should be avoided.
Example Default Value
21600
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editSPF (Added in version 4.8.0-393)

Edit an SPF record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
example.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
spf_record_value string
Example Default Value
v=spf1
No*
use_a integer
Description
Should the IP(s) referenced in DNS A Records for this domain be permitted to send mail?
Example Values
1, 0
Example Default Value
0
No*
use_mx integer
Description
Should the hostnames referenced in DNS MX Records for this domain be permitted to send mail?
Example Values
1, 0
Example Default Value
0
No*
use_ptr integer
Description
Should the PTR Records for the sender's IP be used to validate the sender's domain? NOT RECOMMENDED.
Example Values
1, 0
Example Default Value
0
No*
other_servers integer
Description
Do any other hostnames or IPs need to be authorized to send mail for this domain?
Example Values
1, 0
Example Default Value
0
No*
mechanism_a struct (string)
Description
If the domain name has an address record (A or AAAA) that can be resolved to the sender's address, it will match.
No
mechanism_mx struct (string)
Description
If the domain name has an MX record resolving to the sender's address, it will match (i.e. the mail comes from one of the domain's mail servers).
No
mechanism_ip4 struct (string)
Description
If the sender is in a given IPv4 range, match.
No
mechanism_ip6 struct (string)
Description
If the sender is in a given IPv6 range, match.
No
mechanism_ptr struct (string)
Description
If the domain name for the client's address is in the given domain and that domain name resolves to the client's address, match. Input may use macro-expansion. NOT RECOMMENDED.
No
mechanism_exists struct (string)
Description
If there is a valid A Record for the given domain, match. Input may use macro-expansion.
No
mechanism_include struct (string)
Description
Used to include the policies of another domain's SPF record. Similar to the 'Redirect' parameter.
No
all string
Description
Defines how to respond if the record has produced no match.
Example Values
, -all, ~all, ?all, +all
No
redirect string
Description
Redirects verification to use the SPF record of the specified domain. This is useful, for example, if you send mail through your ISP's servers and they have defined an SPF record.
No
explanation string
Description
Defines a DNS name whose TXT Record may be returned along with failure messages. Rarely used, may not be universally supported.
No
* indicates that it's actually required, but probably already has a valid default value

Action: editSRV (Added in version 4.8.0-393)

Edit an SRV record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
service string
Help Entry
The symbolic name of the desired service. For example, _sip, _ldap, etc.
Example Default Value
_sip
No*
protocol string
Help Entry
The name of the protocol with an underscore prepended to avoid collisions with other DNS records. "_TCP" and "_UDP" are the two most common values.
Example Default Value
_tcp
No*
domain string
Example Default Value
example.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
priority integer
Example Default Value
10
No*
weight integer
Example Default Value
100
No*
port integer
Example Default Value
5060
No*
target string
Example Default Value
www.google.com
No*
* indicates that it's actually required, but probably already has a valid default value

Action: editTXT (Added in version 4.8.0-393)

Edit a TXT record.

Input Parameters

Name Type Notes Required?
record_id integer Yes
host string
Example Default Value
example.com
No*
ttl integer
Description
In Seconds
Help Entry
TTL, or Time To Live, is the number of seconds that a record will be considered valid by a server caching the information.
Example Default Value
43200
No*
text string
Example Default Value
example text record
No*
* indicates that it's actually required, but probably already has a valid default value

Action: listRecordIds

This action has been deprecated as of version 4.1.0-247.

MESSAGE: 2009-12-07 use listRecords

List dns records by id.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 
    array (
      0 => '1',
      1 => 'dns-template.com | SOA | ns1.dns-template.com admin@dns-template.com 7200 2048 1048576 21600',
    ),
    1 => 
    array (
      0 => '2',
      1 => 'dns-template.com | A | 1.1.1.1',
    ),
    2 => 
    array (
      0 => '3',
      1 => 'www.dns-template.com | CNAME | dns-template.com',
    ),
  ),
)

Action: listRecords (Added in version 4.1.0-247)

List dns records by id.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 
    array (
      'record_id' => '6',
      'zone_id' => '1',
      'domain' => '1.dns-template.com',
      'type' => 'A',
      'host' => 'mail.dns-template.com',
      'target' => '1.1.1.1',
      'ttl' => '43200',
      'last_update' => '0',
    ),
    1 => 
    array (
      'record_id' => '1520',
      'zone_id' => '160',
      'domain' => 'secondary.com',
      'type' => 'A',
      'host' => 'secondary.com',
      'target' => '123.123.123.123',
      'ttl' => '43200',
      'last_update' => '1336523358',
    ),
    2 => 
    array (
      'record_id' => '1521',
      'zone_id' => '160',
      'domain' => 'secondary.com',
      'type' => 'A',
      'host' => 'mail.secondary.com',
      'target' => '123.123.123.123',
      'ttl' => '43200',
      'last_update' => '1336523358',
    ),
  ),
)

Action: queryRecords (Added in version 4.1.0-247)

Query DNS Records.

Input Parameters

Name Type Notes Required?
zone_id integer No
domain struct (string)
Example Values
example.com, mydomain.com, pointer.com, secondary.com
No
type struct (string)
Example Values
A, CNAME, NS, MX, PTR, TXT, SOA, SPF, SRV, AAAA, NAPTR
No
last_update string No
uni integer
Example Values
1, 0
Example Default Value
0
No*
show_domain integer
Example Values
1, 0
Example Default Value
1
No*
* indicates that it's actually required, but probably already has a valid default value