---
title: "Allocating DNS Records"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53055740/Allocating%20DNS%20Records"
format: markdown
---
To allocate DNS records such as A Record, PTR Record, and CNAME Record, it is mandatory to manually configure authoritative and reverse mapping zones in NIOS for the creation of these records. For more information, see <u>*[Configuring DNS Zones](https://infoblox-docs.atlassian.net/wiki/spaces/nios85draft/pages/26476927)*</u>.

# infoblox_a_record

For more information, see the *A Record* section in the *[Infoblox NIOS Documentation](https://docs.infoblox.com/)*.

The following table describes the mandatory and optional parameters used for an A record.

| **Sr No.** | **Parameter** | **Mandatory/Optional** | **Description** |
| --- | --- | --- | --- |
| 1 | `network_view_name` | Optional | Specifies the network view name available in the NIOS appliance. |
| 2 | `vm_name` | Mandatory | Specifies the name of the virtual machine. |
| 3 | `cidr` | Mandatory | Specifies the address in `cidr` format. |
| 4 | `zone` | Mandatory | Specifies the zone under which the record has to be created. |
| 5 | `dns_view` | Mandatory | Specifies the DNS view under which the zone that has to be created. |
| 6 | `ip_addr` | Optional | Specifies the IP address of the instance in the cloud.<br>For static allocation, set this field with a valid IP address. |
| 7 | `vm_id` | Optional | Specifies the instance ID. |
| 8 | `tenant_id` | Mandatory | Specifies the unique identifier of a tenant in the cloud.<br>Tenant ID is the name of the cloud provider with which you want to integrate. However, if there is no cloud provider, you can specify any dummy value.<br>The tenant ID differentiates the cloud providers in NIOS. For more information, see <u>*[Viewing All Tenants](https://infoblox-docs.atlassian.net/wiki/spaces/nios85/pages/35386136)*</u>. |

## Example

`resource "infoblox_a_record" "demo_record"`

`{`  
`network_view_name="demo1"`  
`vm_name="vmname1"`  
`cidr=10.0.0.0./24`  
`ip_addr="10.0.0.2"`  
`dns_view="default"`  
`zone="aa.com"`  
`tenant_id="test"`

`}`

# infoblox_ptr_record

For more information, see the PTR Record section in the *[Infoblox NIOS Documentation](https://docs.infoblox.com/)*.

The following table describes the mandatory and optional parameters used for a PTR Record.

| **Sr No.** | **Parameter** | **Mandatory/Optional** | **Description** |
| --- | --- | --- | --- |
| 1 | `network_view_name` | Optional | Specifies the network view name available in the NIOS server. |
| 2 | `vm_name` | Mandatory | Specifies the name of the virtual machine. |
| 3 | `cidr` | Mandatory | Specifies the address in cidr format. |
| 4 | `zone` | Mandatory | Specifies the zone under which the record has to be created. |
| 5 | `dns_view` | Mandatory | Specifies the DNS view under which the zone has been created. |
| 6 | `ip_addr` | Optional | Specifies the IP address of the instance in the cloud.<br>For static allocation, set the field with a valid IP. |
| 7 | `vm_id` | Optional | Specifies the instance ID. |
| 8 | `tenant_id` | Mandatory | Specifies the unique identifier of the tenant in the cloud.<br>Tenant ID is the name of the cloud provider with which you want to integrate. However, if there is no cloud provider, you can specify any dummy value.<br>The tenant ID differentiates the cloud providers in NIOS. For more information, see <u>*[Viewing All Tenants](https://docs.infoblox.com/display/nios85draft/Viewing+Cloud+Objects)*</u>. |

## Example

`resource "infoblox_ptr_record" "demo_ptr"`

`{`  
`network_view_name="demo1"`  
`vm_name="vmname1"`  
`cidr=10.10.20.0/24`  
`ip_addr="10.0.0.2"`  
`dns_view="default"`  
`zone="aa.com"`  
`tenant_id="test"`

`}`

# infoblox_cname_record

For more information, see the CNAME Record section in the *[Infoblox NIOS Documentation](https://docs.infoblox.com/)*.

The following table describes the mandatory and optional parameters used for a CNAME record.

| **Sr No.** | **Parameter** | **Mandatory/Optional** | **Description** |
| --- | --- | --- | --- |
| 1 | `zone` | Mandatory | The zone under which the record has to be created. |
| 2 | `dns_view` | Mandatory | Specifies the DNS view under which the zone has been created. |
| 3 | `canonical` | Mandatory | Specifies the canonical name for the record. |
| 4 | `alias` | Mandatory | Specifies the alias name for the record. |
| 5 | `vm_name` | Optional | Specifies the name of the virtual machine. |
| 6 | `vm_id` | Optional | Specifies the instance ID. |
| 7 | `tenant_id` | Mandatory | Specifies the unique identifier of the tenant in the cloud.<br>Tenant ID is the name of the cloud provider with which you want to integrate. However, if there is no cloud provider, you can specify any dummy value.<br>The tenant ID differentiates the cloud providers in NIOS. For more information, see <u>*[Viewing All Tenants](https://docs.infoblox.com/display/nios85draft/Viewing+Cloud+Objects)*</u>. |

## Example

`resource "infoblox_cname_record" "demo_cname"`

`{`  
`canonical="${infoblox_ip_allocation.demo_allocation.vm_name}"`  
`zone="aa.com"`  
`dns_view="default"`  
`alias="ssas"`  
`tenant_id="test"`

`}`