---
title: "Authoritative Name Server Group"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/45973602/Authoritative%20Name%20Server%20Group"
format: markdown
---
Use the `nios_nsgroup` module to create, update, or remove an name server group object of type 'Authoritative' from NIOS. A name server group is a collection of one or more primary DNS servers and one or more secondary DNS servers. For more information about authoritative name server groups, see the *Using Name Server Groups* topic in the *[Infoblox NIOS Documentation](https://docs.infoblox.com)*

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

| **Parameter** | **Required/Optional** | **Description** |
| --- | --- | --- |
| `name` | Required | Specifies the name of the NIOS name server group consisting of authoritative name servers that needs to be managed. |
| `grid_primary` | Optional | Specifies the host that must be used as the primary server in this name server group.  
It must be a Grid member. This option is required when you set the `use_external_primaries` parameter to `false`.<br>Configure the following subparameters:<br>- `name` (required): Specifies the name of the Grid member for identifying the host.
- `enable_preferred_primaries`: Specifies a flag that indicates whether the values of field `preferred_primaries` of this member are used (see the Infoblox WAPI documentation).  
The default value is `false`.
- `grid_replicate`: Determines whether to use zone transfer or Grid replication. Set it to `true` to use DNS zone transfers or set it to `false` to use ID Grid Replication.  
The default value is `false`.
- `lead`: This flag determines whether the Grid lead secondary name server performs zone transfers to non lead secondaries. The default value is `false`.
- `stealth`: Configures the external name server as the stealth server (without a name server record) in zones. The default value is `false`.
- `preferred_primaries`: Provides a list of elements such as `external_primaries` to set the precedence of preferred primary name servers.
  - `address` (required): Configures the IP address of the external name server.
  - `name` (required): Sets a label for the external name server.
  - `stealth`: Configures the external name server as the stealth server (without a name server record) in the zones.  
The default value is `false`.
  - `tsig_key_name` (required): Sets a label for the `tsig_key` value.
  - `tsig_key_alg`: Specifies the algorithm used for the `tsig_key` in use.  
Options: ['`HMAC-MD5`', '`HMAC-SHA256`']  
The default value is `HMAC-MD5`.
  - `tsig_key`: Sets a DNS TSIG key for the name server to secure zone transfers (AFXRs). |
| `grid_secondaries` | Optional | Specifies the list of Grid member hosts that act as secondary name servers.  
This option is required when setting `use_external_primaries` to `true`.<br>Configure the subparameters as defined for the `grid primary` parameter in this table. |
| `is_grid_default` | Optional | Specifies whether this name server group is the default name server group.  
If you set this parameter to `true` this name server group will become the default name server group for new zones. The default value is `false`. |
| `use_external_primary` | Optional | Determines whether the name server group is to use an external primary name server.  
The default value is `false`. To modify this field, you must define `grid_secondaries` and `external_primaries` parameters. |
| `external_primaries` | Optional | Configures a list of external name servers (non-members of the Grid).  
Use this field when setting `use_external_primaries` to true.<br>- `address` (required): Configures the IP address of the external name server.
- `name` (required): Sets a label for the external name server.
- `stealth`: Configures the external name server as the stealth server (without a name server record) in the zones.  
The default value is `false`.
- `tsig_key_name` (required): Sets a label for the `tsig_key` value.
- `tsig_key_alg`: Specifies the algorithm used for the `tsig_key` in use.  
Options: ['`HMAC-MD5`', '`HMAC-SHA256`']  
The default value is `HMAC-MD5`.
- `tsig_key`: Sets a DNS TSIG key for the name server to secure zone transfers (AFXRs). |
| `external_secondaries` | Optional | Defines a list of external secondary name servers, that are not members of the Grid.  
Configure the subparameters similar to the `external_primaries` parameter described earlier. |
| `extattrs` | Optional | Specifies extensible attributes for the DNS name server group object. |
| `state` | Optional | Specifies the state of the DNS name server group instance on the NIOS server.  
Set one of the following values:<br>- `present` (default): creates or updates the group.
- `absent`: Removes the group. |
| `comment` | Optional | Describes the DNS name server group 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 the list of subparameters in the *[NIOS Modules for Ansible Collections](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44525470)* topic. |
| `connection` | Required | The `nios_nsgroup` module must be run locally. |

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

`name: Create simple infoblox name server group`  
`infoblox.nios_modules.nios_nsgroup:`  
`  name: my-simple-group`  
`  comment: "this is a simple name server group"`  
`  grid_primary:`  
`   - name: infoblox-test.example.com`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`


`name: Create infoblox name server group with external primaries`  
`infoblox.nios_modules.nios_nsgroup:`  
`  name: my-example-group`  
`  use_external_primary: true`  
`  comment: "this is my example name server group"`  
`  external_primaries: "{{ ext_nameservers }}"`  
`  grid_secondaries:`  
`    - name: infoblox-test.example.com`  
`      lead: True`  
`      preferred_primaries: "{{ ext_nameservers }}"`  
`  state: present`  
`  provider:`  
`    host: <nios_hostname_or_hostip>`  
`    username: <nios_username>`  
`    password: <nios_password>`  
`connection: local`