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

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

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the fully qualified host name of the record to add, update, or remove from NIOS.<br>To update the name of an SRV 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 SRV record with.  
If a value is not specified, the default view configured in NIOS is used. |
| `port` | Optional | Specifies the port of this SRV record.  
The valid values are in the range of 0 to 65535 (inclusive) that are formatted as 32-bit unsigned integers. |
| `priority` | Optional | Specifies the priority for this SRV record.  
The valid values are in the range of 0 to 65535 (inclusive) that are formatted as 32-bit unsigned integers. |
| `target` | Optional | Specifies the target FQDN for this SRV record. |
| `weight` | Optional | Specifies the weight for this SRV record.  
The valid values are in the range of 0 to 65535 (inclusive) that are formatted as 32-bit unsigned integers. |
| `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 SRV record object. |
| `state` | Optional | Specifies the state of the SRV 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 SRV 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><span style="color: #172b4d">*[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)*</span><span style="color: #172b4d"> topic.</span> |
| `connection` | Required | The `nios_srv_record` module must be run locally. |

> ⚠️ **Note**
> ⚠️ 
> ⚠️ <span style="color: #000000">When creating an SRV record, you must specify values for the </span>`name`<span style="color: #000000">, </span>`port`<span style="color: #000000">, </span>`priority`<span style="color: #000000">, </span>`target`<span style="color: #000000">, and </span>`weight`<span style="color: #000000"> parameters.</span>

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

`name: Configure an SRV record`  
`infoblox.nios_modules.nios_srv_record:`  
`  name: sip. tcp.service.ansible.com`  
`  port: 5080`  
`  priority: 10`  
`  target: service1.ansible.com`  
`  weight: 10`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`  


`name: Update the name of an SRV record`  
`infoblox.nios_modules.nios_srv_record:`  
`  name: {old_name: _sip._tcp.service.ansible.com, new_name: _sip._udp.service.ansible.com}`  
`  port: 5080`  
`  priority: 10`  
`  target: service1.ansible.com`  
`  weight: 10`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`