Skip to contents

Deletes DNS records on Netlify for the specified domain using the deleteDnsRecord endpoint of Netlify's RESTful API. DNS records must be provided as either a character vector of DNS record identifiers or a dataframe/tibble with an id column. Further columns are silently ignored.

Usage

netlify_dns_records_delete(
  records,
  domain,
  token = pal::pkg_config_val("netlify_token"),
  max_tries = 3L
)

Arguments

records

DNS records to delete. A character vector of record identifiers or a dataframe/tibble with an id column. Further columns are silently ignored.

domain

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

token

Netlify personal access token used for authentication. A character scalar.

max_tries

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

Value

A character vector of deleted record identifiers, invisibly.

Details

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

See also

Other Netlify functions: netlify_dns_records_get(), netlify_dns_records_set()

Examples

if (FALSE) { # \dontrun{
yay::netlify_dns_records_delete(domain = "my.site",
                                records = "xyz123")

# The output of `netlify_dns_records_get()` can directly be fed. To delete all (!) records:
yay::netlify_dns_records_get(domain = "my.site") |>
  dplyr::filter(!managed) |>
  yay::netlify_dns_records_delete(domain = "my.site")} # }