---
title: "A Record"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/45074766/A%20Record"
format: markdown
---
<span style="color: #000000">Use the </span>`nios_a_record`<span style="color: #000000"> module to create, update, or remove an A record object from a NIOS Grid.</span>

<span style="color: #000000">The following table describes the parameters you can define in the </span>`nios_a_record`<span style="color: #000000"> module:</span>

| <span style="color: #000000">**Parameter**</span> | <span style="color: #000000">**Required/Optional**</span> | <span style="color: #000000">**Description**</span> |
| --- | --- | --- |
| `name` | <span style="color: #000000">Required</span> | <span style="color: #000000">Specifies the fully qualified host name to add or remove from NIOS.</span><br>To update the name of an A record object, define a dictionary object that contains the following parameters:<br>- `old_name`: Specifies the existing name that must be changed.
- `new_name`: Specifies the new name. |
| `dns_view/view` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Sets the DNS view to associate the A record with.</span>  
If a value is not specified, default is used as the DNS view name.  
If you are using a custom DNS view, then you must specify this parameter. |
| `ipv4addr`/  
`ipv4` | <span style="color: #000000">Required</span> | <span style="color: #000000">Specifies the IPv4 address for an A record.</span><br>- To allocate a dynamic IP address the A record, define a dictionary object that contains <span style="color: #000000">the </span>`nios_next_ip`<span style="color: #000000"> parameter.</span>
- To update an A record with a static IP address, define a dictionary object that contains the following parameters:
  - `old_ipv4addr`: Specifies the IP address that must be changed.
  - `new_ipv4addr`: Specifies the new IP address.
- To update an A record with a dynamic IP address, define a dictionary object that contains the `old_ipv4addr` and `nios_next_ip` parameters.  
Example:  
`ipv4: {'old_ipv4addr': '10.0.0.5', nios_next_ip: 80.0.0.0/24}` |
| `ttl` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Specifies the Time To Live (TTL) value for the record. The duration that the record is valid for, in seconds (cached).</span> |
| `extattrs` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Specifies the extensible attributes for the A record object.</span> |
| `state` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Specifies the state of the A record instance on the NIOS server. Set one of the following values:</span><br>- `present`<span style="color: #000000"> (default): Configures the record.</span>
- `absent`<span style="color: #000000">: Removes the record.</span> |
| `comment` | <span style="color: #000000">Optional</span> | <span style="color: #000000">Describes the A record object.</span> |
| `provider` | <span style="color: #000000">Required</span> | <span style="color: #000000">Defines the details of the connection:</span><br>- `host`<span style="color: #000000">: The DNS host name or IP address to connect to the remote instance of NIOS.</span>
- `username`<span style="color: #000000">: The user name to use for authenticating the connection to the remote instance.</span>
- `password`<span style="color: #000000">: The password to use for authenticating the connection to the remote instance.</span><br><span style="color: #000000">For information on additional fields you can define, see the list of subparameters in the </span><span style="color: #000000">*[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470/NIOS+Modules+for+Ansible+Collections#Providerparameters)*</span><span style="color: #000000"> topic</span><span style="color: #ff0000">.</span> |
| `connection` | <span style="color: #000000">Required</span> | <span style="color: #000000">The </span>`nios_a_record`<span style="color: #000000"> module must be run locally.</span> |

## <span style="color: #000000">Examples</span>

`name:configure an A record`  
`infoblox.nios_modules.nios_a_record:`  
`  name: a.ansibletestzone.com`  
`  ipv4: 192.168.10.1`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Create Nios A record in custom DNS view`  
`infoblox.nios_modules.nios_a_record:`  
`  name: v56.parent.com`  
`  view: custom_view`  
`  ipv4: {nios_next_ip: "192.170.10.0/24"}`  
`  comment: Created with Ansible`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Update an A record in custom view with a dynamic IP using nios_next_ip`  
`infoblox.nios_modules.nios_a_record:`  
`  name: test.parent.com`  
`  view: default.custom`  
`  ipv4: {'old_ipv4addr': '10.0.0.5', nios_next_ip: 80.0.0.0/24}`  
`  comment: this is a test comment`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Update an A record with a static IP`  
`infoblox.nios_modules.nios_a_record:`  
`  name: test.parent.com`  
`  ipv4: {'old_ipv4addr': 30.0.0.10, 'new_ipv4addr': 37.0.0.10}`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Update host name of an A record`  
`infoblox.nios_modules.nios_a_record:`  
`  name: {new_name: a_new.ansible.com, old_name: a.ansible.com}`  
`  ipv4: 192.168.10.1`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`