---
title: "TXT Record"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/45842554/TXT%20Record"
format: markdown
---
Use the `nios_txt_record` module to create, update, or remove a TXT record object from a NIOS Grid.

The following table describes the parameters you can define in the `nios_txt_record` module:

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the fully qualified host name of the TXT record to add, update, or remove from NIOS.<br>To update the name of a TXT 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. |
| `view` | Optional | Specifies the DNS view to associate the TXT record with.  
If a value is not specified, the default view configured in NIOS is used. |
| `text` | Optional | Specifies the text associated with the record. It can contain up to 255 bytes per substring and a total of up to 512 bytes.  
To enter leading, trailing, or embedded spaces in the text, add quotation marks around the text to preserve the spaces. |
| `ttl` | Optional | Specifies the Time To Live (TTL) value for the record.  
The duration that the record is valid for, in seconds (cached). |
| `extattrs` | Optional | Specifies extensible attributes for the TXT record object. |
| `state` | Optional | Specifies the state of the TXT record instance on the NIOS server.  
Set one of the following values:<br>- `present` (default): Configures the record.
- `absent`: Removes the record. |
| `comment` | Optional | Describes the TXT record object. |
| `provider` | Required | Defines the details of the connection:<br>- `host`: The DNS host name or IP address to connect to the remote instance of NIOS.
- `username`: The user name to use for authenticating the connection to the remote instance.
- `password`: The password to use for authenticating the connection to the remote instance.<br>For information on additional fields you can define, see <span style="color: #172b4d">the list of subparameters in the </span>*[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470/NIOS+Modules+for+Ansible+Collections#Providerparameters)*<span style="color: #172b4d"> topic.</span> |
| `connection` | Required | The `nios_txt_record` module must be run locally. |

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

`name: Ensure a text Record Exists`  
`infoblox.nios_modules.nios_txt_record:`  
`  name: fqdn.txt.record.com`  
`  text: mytext`  
`  view: External`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`


`name: Update the name of a TXT record`  
`infoblox.nios_modules.nios_txt_record:`  
`  name: {old_name: sample.txtrecord.com, new_name: newsample.txtrecord.com}`  
`  text: mytext`  
`  state: present`  
`  view: External`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`