Manage DNS host records with namecheap_domain_records
masterThe namecheap_domain_records resource manages the DNS host records of a domain or delegates the domain to custom nameservers.
Management Modes
You can control how the resource interacts with existing DNS records using the mode argument:
MERGE(default): The provider manages only the specific records you declare in your Terraform configuration. Existing records not mentioned in your code remain untouched.OVERWRITE: The provider owns the entire DNS zone. Warning: This mode will permanently delete any existing records (including those created manually or by other tools) that are not explicitly defined in your Terraform configuration.
Since v2.5.0, the provider includes safety warnings during terraform plan and terraform apply when using OVERWRITE mode, providing ready-to-paste record blocks for any live records that would be deleted.
resource "namecheap_domain_records" "my-domain-com" {
domain = "my-domain.com"
email_type = "NONE"
record {
hostname = "blog"
type = "A"
address = "10.11.12.13"
}
}