---
title: "infoblox_ptr_record Resource"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53055774/infoblox_ptr_record%20Resource"
format: markdown
---
The `infoblox_ptr_record` resource allows you to create PTR records in forward and reverse mapping zones. In case of reverse mapping zone, the PTR record maps IP addresses with domain names.

The following table describes the parameters you can define for the `infoblox_ptr_record` resource block:

| **Parameter** | Required/optional | Description | **Example Value** |
| --- | --- | --- | --- |
| `ptrdname` | Required | Specifies the domain name in the FQDN format that the record should point to. | `host1.example.com` |
| `ip_addr` | Required only for static allocation in reverse-mapping zones | Specifies the IPv4 or IPv6 address for record creation.  
For allocating a dynamic IP address, define the `cidr` field instead of this field. | `82.50.36.8` |
| `cidr` | Required only for dynamic allocation in reverse-mapping zones | Specifies the network address in CIDR format, under which the record must be created.  
For static allocation, configure the `ip_addr` field instead of this field. | `10.3.128.0/20` |
| `network_view` | Optional | Specifies the network view to use when allocating an IP address from a network dynamically.   
If a value is not specified, `default` will be used as the network view name.  
For static allocation, do not use this field. | `networkview_name` |
| `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` |
| `ttl` | Optional | Specifies the Time to Live value for the PTR record.  
The parameter does not have a default value. If a value is not specified, then in NIOS, the TTL value is inherited from the parent object of the DNS record for this resource. A TTL value of `0` (zero) means caching should be disabled for this record. | `10` |
| `record_name` | Required only in case of forward mapping zones | Specifies the domain name in FQDN format; it is the name of the DNS PTR record. | `service1.zone21.org` |
| `comment` | Optional | Describes the PTR record. |  |
| `ext_attrs` | Optional | Specifies the set of NIOS extensible attributes that are attached to the PTR record. | `jsonencode({})` |

> ⚠️ **Note**
> ⚠️ 
> ⚠️ - When creating a PTR record in a forward mapping zone, `ptrdname` and `record_name` parameters are required, and `network_view` is optional. The corresponding forward mapping zone must have been already created at the appropriate DNS view.
> ⚠️ - When creating a PTR record in a reverse-mapping zone, you must specify the `ptrdname` parameter with any one of the `ip_addr`, `cidr`, and `record_name` parameters. Configuring any two or all of `ip_addr`, `cidr`, and `record_name` parameters in a resource block is not supported.

## Example of the PTR Record Resource

`// Creation of a PTR record with minimal set of parameters`  
`// to specify an IP address in reverse-mapping zones, use either one`  
`//   1) 'ip_addr' (literally) or`  
`//   2) 'record_name' - in the form of a domain name (ex. 1.0.0.10.in-addr.arpa)`  
`resource "infoblox_ptr_record" "ptr1" {`  
`    ptrdname = "example2.org"`  
`    ip_addr = "10.0.0.1"`  
`}`  
  
`resource "infoblox_ptr_record" "ptr2" {`  
`    ptrdname = "example2.org"`  
`    record_name = "2.0.0.10.in-addr.arpa"`  
`}`  


`// statically allocated PTR-record with full set of parameters`  
`resource "infoblox_ptr_record" "ptr3" {`  
`    ptrdname = "example2.org"`  
`    dns_view = "nondefault_dnsview1"`  
`    ip_addr = "2002:1f93::3"`  
`    comment = "workstation #3"`  
`    ttl = 300 # 5 minutes`  
`    ext_attrs = jsonencode({`  
`       "Location" = "the main office"`  
`     })`  
`}`  


`// dynamically allocated PTR record with minimal set of parameters allocation`  
`resource "infoblox_ptr_record" "ptr4" {`  
`    ptrdname = "example2.org"`  
`    cidr = infoblox_ipv4_network.net1.cidr`  
`}`  


`// dynamically allocated PTR record with full set of parameters, custom network view`  
`resource "infoblox_ptr_record" "ptr5" {`  
`    ptrdname = "example2.org"`  
`    dns_view = "nondefault_dnsview2"`  
`    network_view = "nondefault_netview"`  
`    cidr = "2002:1f93::/64"`  
`    omment = "workstation #5"`  
`    ttl = 300 # 5 minutes`  
`    ext_attrs = jsonencode({`  
`       "Location" = "the main office"`  
`     })`  
`}`  


`// PTR-record in a forward-mapping zone`  
`resource "infoblox_ptr_record" "ptr6_forward" {`  
`    ptrdname = "example1.org"`  
`    record_name = "example1.org"`  
`}`