---
title: "infoblox_a_record Data Source"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/53121478/infoblox_a_record%20Data%20Source"
format: markdown
---
Use the data source to retrieve the following information for an A record, which is managed by a NIOS server:

| **Parameter** | **Description** | **Example** |
| --- | --- | --- |
| `dns_view` | The DNS view in which the record's zone exists. | `default` |
| `ip_addr` | The IPv4 address associated with the A record. | `17.10.0.8` |
| `fqdn` | The fully qualified domain name which the IP address is assigned to. | `blues.test.com` |
| `zone` | The zone that contains the record in the specified DNS view. | `test.com` |
| `ttl` | The Time to Live value of the record, in seconds. | `3600` |
| `comment` | A description of the record. This is a regular comment. | `Temporary A record` |
| `ext_attrs` | The set of extensible attributes of the record, if any. The content is formatted as a string of JSON map. | `{\"TestEA\":56,\"TestEA1\":\"kickoff\"}` |

To retrieve information about A records that match the specified filters, use the `filters` argument and specify the parameters mentioned in the below table. These are the searchable parameters of the corresponding object in Infoblox NIOS WAPI. If you do not specify any parameter, the data source retrieves information about all A records in the NIOS Grid.

<span style="color: #3e3f40">The following table describes the parameters you can define in an </span>`infoblox_a_record`<span style="color: #3e3f40"> data source block:</span>

| **Parameter** | **Alias*** | **Description** |
| --- | --- | --- |
| `name` | `fqdn` | Specifies the fully qualified domain name to which the IP address is assigned. |
| `view` | `dns_view` | <span style="color: #000000">Specifies the DNS view in which the record's zone exists.</span>  
<span style="color: #000000">If a value is not specified, matching records are retrieved from all views in the NIOS Grid.</span> |
| `ipv4addr` | `ip_addr` | <span style="color: #000000">Specifies the IPv4 address associated with the A record.</span> |
| `zone` | `zone` | <span style="color: #000000">Specifies the zone that contains the record.</span> |
| `comment` | `comment` | <span style="color: #000000">Describes the record.</span> |
| <span style="color: #000000">Extensible Attributes</span> | <span style="color: #000000">-</span> | <span style="color: #000000">Specifies the extensible attributes specified for the record. You must specify the</span> key/value pair within the `filters` argument.  
Example:  
`filters = {`  
`"*Site" = "some test site"`  
`"*Location" = "65.8665701230204, -37.00791763398113"`  
`}` |

*<span style="color: #172B4D">Aliases are the parameter names used in the prior releases of Infoblox IPAM Plug-In for Terraform. Do not use the alias names for parameters in the data source blocks. Using them can result in error scenarios</span>.

## Example of the A Record Data Source Block

The following example defines a data source of type `infoblox_a_record` and the name "`a_rec_temp`", which is configured in a Terraform file. You can reference this resource and retrieve information about it.

`resource "infoblox_a_record" "vip_host" {`  
`    fqdn = "very-interesting-host.example.com"`  
`    ip_addr = "10.3.1.65"`  
`    comment = "special host"`  
`    dns_view = "nondefault_dnsview2"`  
`    ttl = 120 // 120s`  
`    ext_attrs = jsonencode({`  
`      "Location" = "65.8665701230204, -37.00791763398113"`  
`    })`  
`}`

`data "infoblox_a_record" "a_rec_temp" {`  
`    filters = {`  
`      name = "very-interesting-host.example.com"`  
`      ipv4addr = "10.3.1.65" //alias is ip_addr`  
`      view = "nondefault_dnsview2"`  
`    }`  
`    `  
`    // This is just to ensure that the record has been created`  
`    // using 'infoblox_a_record' resource block before the data source will be queried.`  
`    depends_on = [infoblox_a_record.vip_host]`  
`}`

`output`` "a_rec_res" {`  
`    value = data.infoblox_a_record.a_rec_temp`  
`}`

`// accessing individual field in results`  
`output`` "a_rec_name" {`  
`    value = data.infoblox_a_record.a_rec_temp.results.0.fqdn //zero represents index of the json object from the results list`  
`}`



`// fetching A-Records through EAs`  
`data "infoblox_a_record" "a_rec_ea" {`  
`    ``filters = {`  
`      "*Site" = "some test site"`  
`      "*Location" = "65.8665701230204, -37.00791763398113"`  
`      ``"*Location!" = "75.``8665701230211``"`  
`    ``}`  
`}`

`output "a_rec_out" {`  
`    value = data.infoblox_a_record.a_rec_ea`  
`}`