---
title: "infoblox_cname_record Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53121506/infoblox_cname_record%20Resource"
format: markdown
---
A CNAME record maps one domain name to another (canonical) one. The `infoblox_cname_record` resource allows you to manage domain name mappings in a NIOS server for CNAME records.

The following table describes the parameters you can define in the `infoblox_cname_record` resource block:

| **Parameter** | **Required/optional** | **Description** | **Example Value** |
| --- | --- | --- | --- |
| `alias` | Required | Specifies the alias name in the FQDN format. | `alias1.example.com` |
| `canonical` | Required | Specifies the canonical name in the FQDN format. | `main.example.com` |
| `ttl` | Optional | Specifies the Time to Live value for the CNAME record.  
There is no default value for this parameter.  
If a value is not specified, then in NIOS, the TTL value is <span style="color: #172b4d">inherited from the parent object of the DNS record for this resource</span>. A TTL value of 0 (zero) means caching should be disabled for this record. | `3600` |
| `dns_view` | Optional | Specifies the DNS view in which the record's zone exists.  
If a value is not specified, `default` will be used as the DNS view name. | `dns_view_name` |
| `comment` | Optional | Describes the CNAME record. | `an example CNAME record` |
| `ext_attrs` | Optional | Specifies the set of NIOS extensible attributes that are attached to the CNAME record. | `jsonencode({})` |

## Example of the CNAME Record Resource

`// minimal set of parameters to create a CNAME-record`  
`resource "infoblox_cname_record" "cname_rec1" {`  
`    canonical = "main.test.net"`  
`    alias = "hq-server.example1.org"`  
`}`


`// full set of parameters to create a CNAME-record`  
`resource "infoblox_cname_record" "cname_rec2" {`  
`  dns_view = "default.nondefault_netview"`  
`  canonical = "strange-place.somewhere.in.the.net"`  
`  alias = "alarm-server.example3.org"`  
`  comment = "we need to keep an eye on this strange host"`  
`  ttl = 0 // disable caching`  
`  ext_attrs = jsonencode({`  
`    Site = "unknown"`  
`    Location = "TBD"`  
`  })`  
`}`