Vultr DocsLatest Content


vultr_dns_record

Updated on 15 September, 2025

A resource for managing DNS records within Vultr domains, allowing creation and configuration of domain name system entries.


Provides a Vultr DNS Record resource. This can be used to create, read, modify, and delete DNS Records.

Example Usage

Create a new DNS Record

hcl
resource "vultr_dns_domain" "my_domain" {
	domain = "domain.com"
	ip = "66.42.94.227"
}

resource "vultr_dns_record" "my_record" {
	domain = "${vultr_dns_domain.my_domain.id}"
	name = "www"
	data = "66.42.94.227"
	type = "A"
}

Argument Reference

The following arguments are supported:

  • data - (Required) IP Address of the instance the domain is associated with.
  • domain - (Required) Name of the DNS Domain this record will belong to.
  • name - (Required) Name (subdomain) for this record.
  • type - (Required) Type of record.
  • priority - (Optional) Priority of this record (only required for MX and SRV).
  • ttl - (Optional) The time to live of this record.

Attributes Reference

The following attributes are exported:

  • id - ID associated with the record.
  • data - IP Address of the instance the domain is associated with.
  • domain - Name of the DNS Domain this record will belong to.
  • name - Name for this record (Can be subdomain).
  • type - Type of record.
  • priority - Priority of this record (only required for MX and SRV).
  • ttl - The time to live of this record.

Import

DNS Records can be imported using the Dns Domain domain and DNS Record ID e.g.

terraform import vultr_dns_record.rec domain.com,1a0019bd-7645-4310-81bd-03bc5906940f

Comments

No comments yet.