Configure and manage DNS records for your domains within the Vultr DNS management interface.
Managing DNS records enables the activation of specific values that define a domain services such as IP addresses, TXT and Mail Exchange (MX) details. Vultr DNS supports all types of DNS records you can create for your domain.
Follow this guide to manage domain DNS records using Vultr DNS, the Vultr Customer Portal, API, CLI, or Terraform.
Send a GET
request to the List DNS domains endpoint and note the target domain in your output.
$ curl "https://api.vultr.com/v2/domains" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST
request to the Create a DNS Record endpoint to create a new DNS record on the domain.
$ curl "https://api.vultr.com/v2/domains/{dns-domain}/records" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET
request to the List Records endpoint to view all active DNS records and note the target record ID.
$ curl "https://api.vultr.com/v2/domains/{dns-domain}/records" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a DELETE
request to the Delete DNS Domain Record endpoint to the DNS record from your domain.
$ curl "https://api.vultr.com/v2/domains/{dns-domain}" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
List all domains available in your Vultr account and note the target domain name.
$ vultr-cli dns domain list
Create a new DNS record on the domain.
$ vultr-cli dns record create --domain <dns-domain> --type <record-type> --data <record-data> --name <record-specification> --ttl <ttl-value>
List all active DNS records on the domain and note the target record ID.
$ vultr-cli dns record list <dns-domain>
Delete the DNS record.
$ vultr-cli dns record delete <dns-domain> <dns-record-id>
Open your Terraform configuration where the domain is defined.
Add a record, update fields, or remove the block to delete.
resource "vultr_dns_record" "txt_spf" {
domain = var.domain
name = "@"
type = "TXT"
data = "v=spf1 include:mail.example.com ~all"
ttl = 3600
}
Apply the configuration and observe the following output:
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
No comments yet.