netlify_dns_records_set: Set Netlify DNS records

netlify_dns_records_setR Documentation

Set Netlify DNS records


Sets DNS records on Netlify for the specified domain using the createDnsRecord endpoint of Netlify's REST API. DNS records must be provided as a dataframe/tibble with the columns "type", "hostname", "value", "ttl", "priority", "weight", "port", "flag" and "tag". Further columns are silently ignored.


netlify_dns_records_set(records, domain, token, max_tries = 3L)



DNS records. A dataframe/tibble with the columns "type", "hostname", "value", "ttl", "priority", "weight", "port", "flag" and "tag". The first three columns are mandatory, columns not listed here are silently ignored.


Domain name to set DNS records for. This is translated into the corresponding Netlify DNS Zone. A character scalar.


Personal access token used for authentication.


Maximum number of attempts to retry in case of an HTTP error. An integerish scalar.


Supported are the DNS record types ALIAS, CAA, CNAME, MX, NS, SPF, SRV and TXT. A and AAAA (or NETLIFY and NETLIFY6, respectively) cannot be set via the API and must be configured via Netlify's web interface.


The newly set DNS records. A tibble with the columns id, dns_zone_id, site_id, managed, type, hostname, value, ttl, priority, weight, port, flag, and tag, invisibly.

See Also

Other Netlify functions: netlify_dns_records_delete(), netlify_dns_records_get()


## Not run: 
  ~type,   ~hostname,            ~value,           ~ttl, ~priority, ~weight, ~port, ~flag, ~tag,
  "CAA",   "",            "", 3600L, NA,      NA,      NA,    NA,    NA,
  "CNAME", "autoconfig",         "",     3600L, NA,      NA,      NA,    NA,    NA,
  "MX",    "",            "", 3600L, NA,   NA,      NA,    NA,    NA,
  "SRV",   "", "",    3600L, 1L,   1L,      443L,  NA,    NA,
  "TXT",   "_mta-sts",           "v=STSv1; id=001",    3600L, NA,   NA,      NA,    NA,    NA) |>
  yay::netlify_dns_records_set(domain = "",
                               token  = "XYZ1234")
# to use a TOML file that defines a `records` table as input:
pal::toml_read("dns_records.toml")$records |>
  purrr::map_dfr(tibble::as_tibble_row) |>
  yay::netlify_dns_records_set(domain = "",
                               token  = Sys.getenv("NETLIFY_PAT"))
## End(Not run)

salim-b/yay documentation built on May 17, 2024, 5:24 a.m.