records
Creates, updates, deletes, gets or lists a records
resource.
Overview
Name | records |
Type | Resource |
Id | linode.domains.records |
Fields
The following fields are returned by SELECT
queries:
- get_domain_record
- get_domain_records
A Domain Record object.
Name | Datatype | Description |
---|---|---|
id | integer | Read-only This Record's unique ID. |
name | string | Filterable The name of this Record. For requests, this property's actual usage and whether it is required depends on the type of record this represents: A and AAAA : The hostname or FQDN of the Record. NS : The subdomain, if any, to use with the Domain of the Record. Wildcard NS records (* ) are not supported. MX : The mail subdomain. For example, sub for the address user@sub.example.com under the example.com Domain. - The left-most subdomain component may be an asterisk (* ) to designate a wildcard subdomain. - Other subdomain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters. - Must be an empty string ("" ) for a Null MX Record. CNAME : The hostname. Must be unique. Required. TXT : The hostname. SRV : Unused. Use the service property to set the service name for this record. CAA : The subdomain. Omit or enter an empty string ("" ) to apply to the entire Domain. PTR : See our guide on how to Configure Your Linode for Reverse DNS (rDNS). (example: test) |
created | string (date-time) | Read-only When this Domain Record was created. (example: 2018-01-01T00:01:01) |
port | integer | The port this Record points to. Only valid and required for SRV record requests. |
priority | integer | The priority of the target host for this Record. Lower values are preferred. Only valid for MX and SRV record requests. Required for SRV record requests. Defaults to 0 for MX record requests. Must be 0 for Null MX records. |
protocol | string | The protocol this Record's service communicates with. An underscore (_ ) is prepended automatically to the submitted value for this property. Only valid for SRV record requests. |
service | string | The name of the service. An underscore (_ ) is prepended and a period (. ) is appended automatically to the submitted value for this property. Only valid and required for SRV record requests. |
tag | string | Filterable The tag portion of a CAA record. Only valid and required for CAA record requests. |
target | string | Filterable The target for this Record. For requests, this property's actual usage and whether it is required depends on the type of record this represents: A and AAAA : The IP address. Use [remote_addr] to submit the IPv4 address of the request. Required. NS : The name server. Must be a valid domain. Required. MX : The mail server. Must be a valid domain unless creating a Null MX Record. Required. - Must have less than 254 total characters. - The left-most domain component may be an asterisk (* ) to designate a wildcard domain. - Other domain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters. - To create a Null MX Record, first remove any additional MX records, then create an MX record with empty strings ("" ) for the target and name . If a Domain has a Null MX record, new MX records cannot be created. CNAME : The alias. Must be a valid domain. Required. TXT : The value. Required. SRV : The target domain or subdomain. If a subdomain is entered, it is automatically used with the Domain. To configure for a different domain, enter a valid FQDN. For example, the value www with a Domain for example.com results in a target set to www.example.com , whereas the value sample.com results in a target set to sample.com . Required. CAA : The value. For issue or issuewild tags, the domain of your certificate issuer. For the iodef tag, a contact or submission URL (domain, http, https, or mailto). Requirements depend on the tag for this record: - issue : The domain of your certificate issuer. Must include a valid domain. May include additional parameters separated with semicolons (; ), for example: www.example.com; foo=bar - issuewild : The domain of your wildcard certificate issuer. Must be a valid domain and must not start with an asterisk (* ). - iodef : Must be either (1) a valid domain, (2) a valid domain prepended with http:// or https:// , or (3) a valid email address prepended with mailto: . PTR : Required. See our guide on how to Configure Your Linode for Reverse DNS (rDNS). With the exception of A, AAAA, and CAA records, this field accepts a trailing period. (example: 192.0.2.0) |
ttl_sec | integer | "Time to Live" - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value. |
type | string | Filterable The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. For more information, see the guides on DNS Record Types. (example: A) |
updated | string (date-time) | Read-only When this Domain Record was last updated. (example: 2018-01-01T00:01:01) |
weight | integer | The relative weight of this Record used in the case of identical priority. Higher values are preferred. Only valid and required for SRV record requests. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_domain_record | select | View a single Record on this Domain. Learn more... Learn more... | ||
get_domain_records | select | page , page_size | Returns a paginated list of Records configured on a Domain in Linode's DNS Manager. Learn more... Learn more... | |
post_domain_record | insert | data__type | Adds a new Domain Record to the zonefile this Domain represents. Each domain can have up to 12,000 active records. Learn more... Learn more... | |
put_domain_record | replace | Updates a single Record on this Domain. Learn more... Learn more... | ||
delete_domain_record | delete | Deletes a Record on this Domain. Learn more... Learn more... |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
page | integer | The page of a collection to return. |
page_size | integer | The number of items to return per page. |
SELECT
examples
- get_domain_record
- get_domain_records
View a single Record on this Domain.
Learn more...
Learn more...
SELECT
id,
name,
created,
port,
priority,
protocol,
service,
tag,
target,
ttl_sec,
type,
updated,
weight
FROM linode.domains.records;
Returns a paginated list of Records configured on a Domain in Linode's DNS Manager.
Learn more...
Learn more...
SELECT
data,
page,
pages,
results
FROM linode.domains.records
WHERE page = '{{ page }}'
AND page_size = '{{ page_size }}';
INSERT
examples
- post_domain_record
- Manifest
Adds a new Domain Record to the zonefile this Domain represents.
Each domain can have up to 12,000 active records.
Learn more...
Learn more...
INSERT INTO linode.domains.records (
data__name,
data__port,
data__priority,
data__protocol,
data__service,
data__tag,
data__target,
data__ttl_sec,
data__type,
data__weight
)
SELECT
'{{ name }}',
{{ port }},
{{ priority }},
'{{ protocol }}',
'{{ service }}',
'{{ tag }}',
'{{ target }}',
{{ ttl_sec }},
'{{ type }}' --required,
{{ weight }}
RETURNING
id,
name,
created,
port,
priority,
protocol,
service,
tag,
target,
ttl_sec,
type,
updated,
weight
;
# Description fields are for documentation purposes
- name: records
props:
- name: name
value: string
description: >
__Filterable__ The name of this Record. For requests, this property's actual usage and whether it is required depends on the type of record this represents:
`A` and `AAAA`: The hostname or FQDN of the Record.
`NS`: The subdomain, if any, to use with the Domain of the Record. Wildcard NS records (`*`) are not supported.
`MX`: The mail subdomain. For example, `sub` for the address `user@sub.example.com` under the `example.com` Domain.
- The left-most subdomain component may be an asterisk (`*`) to designate a wildcard subdomain.
- Other subdomain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters.
- Must be an empty string (`""`) for a Null MX Record.
`CNAME`: The hostname. Must be unique. Required.
`TXT`: The hostname.
`SRV`: Unused. Use the `service` property to set the service name for this record.
`CAA`: The subdomain. Omit or enter an empty string (`""`) to apply to the entire Domain.
`PTR`: See our guide on how to [Configure Your Linode for Reverse DNS
(rDNS)](https://www.linode.com/docs/guides/configure-rdns/).
- name: port
value: integer
description: >
The port this Record points to. Only valid and required for SRV record requests.
- name: priority
value: integer
description: >
The priority of the target host for this Record. Lower values are preferred. Only valid for MX and SRV record requests. Required for SRV record requests.
Defaults to `0` for MX record requests. Must be `0` for Null MX records.
- name: protocol
value: string
description: >
The protocol this Record's service communicates with. An underscore (`_`) is prepended automatically to the submitted value for this property. Only valid for SRV record requests.
- name: service
value: string
description: >
The name of the service. An underscore (`_`) is prepended and a period (`.`) is appended automatically to the submitted value for this property. Only valid and required for SRV record requests.
- name: tag
value: string
description: >
__Filterable__ The tag portion of a CAA record. Only valid and required for CAA record requests.
valid_values: ['issue', 'issuewild', 'iodef']
- name: target
value: string
description: >
__Filterable__ The target for this Record. For requests, this property's actual usage and whether it is required depends on the type of record this represents:
`A` and `AAAA`: The IP address. Use `[remote_addr]` to submit the IPv4 address of the request. Required.
`NS`: The name server. Must be a valid domain. Required.
`MX`: The mail server. Must be a valid domain unless creating a Null MX Record. Required.
- Must have less than 254 total characters.
- The left-most domain component may be an asterisk (`*`) to designate a wildcard domain.
- Other domain components must only contain letters, digits, and hyphens, start with a letter, end with a letter or digit, and contain less than 64 characters.
- To create a [Null MX Record](https://datatracker.ietf.org/doc/html/rfc7505), first [remove](https://techdocs.akamai.com/linode-api/reference/delete-domain-record) any additional MX records, then create an MX record with empty strings (`""`) for the `target` and `name`. If a Domain has a Null MX record, new MX records cannot be created.
`CNAME`: The alias. Must be a valid domain. Required.
`TXT`: The value. Required.
`SRV`: The target domain or subdomain. If a subdomain is entered, it is automatically used with the Domain.
To configure for a different domain, enter a valid FQDN. For example, the value `www` with a Domain for
`example.com` results in a target set to `www.example.com`, whereas the value `sample.com` results in a
target set to `sample.com`. Required.
`CAA`: The value. For `issue` or `issuewild` tags, the domain of your certificate issuer. For the `iodef`
tag, a contact or submission URL (domain, http, https, or mailto). Requirements depend on the tag for this record:
- `issue`: The domain of your certificate issuer. Must include a valid domain. May include additional parameters separated with semicolons (`;`), for example: `www.example.com; foo=bar`
- `issuewild`: The domain of your wildcard certificate issuer. Must be a valid domain and must not start with an asterisk (`*`).
- `iodef`: Must be either (1) a valid domain, (2) a valid domain prepended with `http://` or `https://`, or (3) a valid email address prepended with `mailto:`.
`PTR`: Required. See our guide on how to [Configure Your Linode for Reverse DNS
(rDNS)](https://www.linode.com/docs/guides/configure-rdns/).
With the exception of A, AAAA, and CAA records, this field accepts a trailing period.
- name: ttl_sec
value: integer
description: >
"Time to Live" - the amount of time in seconds that this Domain's records may be cached by resolvers or other domain servers. Valid values are 300, 3600, 7200, 14400, 28800, 57600, 86400, 172800, 345600, 604800, 1209600, and 2419200 - any other value will be rounded to the nearest valid value.
- name: type
value: string
description: >
__Filterable__ The type of Record this is in the DNS system. For example, A records associate a domain name with an IPv4 address, and AAAA records associate a domain name with an IPv6 address. For more information, see the guides on [DNS Record Types](https://www.linode.com/docs/products/networking/dns-manager/guides/#dns-record-types).
valid_values: ['A', 'AAAA', 'NS', 'MX', 'CNAME', 'TXT', 'SRV', 'PTR', 'CAA']
- name: weight
value: integer
description: >
The relative weight of this Record used in the case of identical priority. Higher values are preferred. Only valid and required for SRV record requests.
REPLACE
examples
- put_domain_record
Updates a single Record on this Domain.
Learn more...
Learn more...
REPLACE linode.domains.records
SET
data__name = '{{ name }}',
data__port = {{ port }},
data__priority = {{ priority }},
data__protocol = '{{ protocol }}',
data__service = '{{ service }}',
data__tag = '{{ tag }}',
data__target = '{{ target }}',
data__ttl_sec = {{ ttl_sec }},
data__weight = {{ weight }}
WHERE
RETURNING
id,
name,
created,
port,
priority,
protocol,
service,
tag,
target,
ttl_sec,
type,
updated,
weight;
DELETE
examples
- delete_domain_record
Deletes a Record on this Domain.
Learn more...
Learn more...
DELETE FROM linode.domains.records;