---
title: "infoblox_dns_view Data Source"
canonical: "https://docs.infoblox.com/space/ipamdriverterraform/381190540/infoblox_dns_view%20Data%20Source"
format: markdown
---
Use the `infoblox_dns_view` data source to retrieve the following information about a DNS view resource from the corresponding object in NIOS:

| **Parameter** | **Description** | **Example** |
| --- | --- | --- |
| `name` | The name of the DNS view. | `custom_dnsview` |
| `network_view` | The name of the network view object associated with this DNS view. | `nondefault_netview` |
| `comment` | A description of the DNS view. This is a regular comment. | `The DNS view object in NIOS.` |
| `ext_attrs` | The set of extensible attributes of the DNS view, if any. The content is formatted as a string of JSON map. | `{\"Owner\":\"State Library\", \"Expires\":\"never\"}` |

To retrieve information about DNS views 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 DNS views in the NIOS Grid.

The following table describes the parameters you can define in the `infoblox_dns_view` data source block:

| **Parameter** | **Description** |
| --- | --- |
| `name` | The name of the DNS view. |
| `network view` | The name of network view in which DNS view exists.  
If a value is not specified, matching objects are retrieved from all network views in the NIOS Grid. |
| `comment` | The description of the DNS view |
| Extensible Attributes | Specifies the extensible attributes specified for the DNS view. You must specify the key/value pair within the `filters` argument.  
Example:  
`filters = {`  
`"*Site" = "some test site"`  
`}` |

## Example of the DNS View Data Source Block

`resource "infoblox_dns_view" "view1" {`  
`   name = "test_blog"`  
`   comment = "strange test dnsview"`  
`   ext_attrs = jsonencode({`  
`     "Site" = "New Location"`  
`   })`  
`}`

`data "infoblox_dns_view" "dsview" {`  
`    filters = {`  
`      name = "customview"`  
`      network_view = "nondefault_netview"`  
`    }`  
`// This is just to ensure that the record has been be created`  
`// using 'infoblox_dns_view' resource block before the data source will be queried.`  
`   depends_on = [infoblox_dns_view.view1]`  
`}`

`output "dsview_res" {`  
 `  value = data.infoblox_dns_view.dsview`  
`}`  


`// accessing individual field in results`  
`output "dsview_name" {`  
`    value = data.infoblox_dns_view.dsview_res.results.0.name //zero represents index of json object from results list`  
`}`

  
`// accessing DNS Views through EA's`  
`data "infoblox_dns_view" "dsview_ea" {`  
`    filters = {`  
`      "*Location" = "65.8665701230204, -37.00791763398113"`  
`      "*Location!" = "75.8665701230211"`  
`    }`  
`}`

`output "dsview_out" {`  
`    value = data.infoblox_dns_view.dsview_ea`  
`}`