effectivelywild.technitium_dns.technitium_dns_zone module – Manage DNS zones with state-based approach
Note
This module is part of the effectivelywild.technitium_dns collection (version 1.1.2).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install effectivelywild.technitium_dns.
To use it in a playbook, specify: effectivelywild.technitium_dns.technitium_dns_zone.
New in effectivelywild.technitium_dns 1.0.0
Synopsis
Manage DNS zones in Technitium DNS Server.
Supports all zone types with type-specific parameters.
Parameters
Parameter |
Comments |
|---|---|
Port for the Technitium DNS API. Defaults to 5380 Default: |
|
API token for authenticating with the Technitium DNS API |
|
Base URL for the Technitium DNS API |
|
The name of the catalog zone to become its member zone |
|
Enable DNSSEC for the zone When enabled, the zone will be signed with DNSSEC Choices:
|
|
Enable DNSSEC validation (Forwarder only) Choices:
|
|
Address of DNS server to use as forwarder (Forwarder only) |
|
Initialize Conditional Forwarder zone with FWD record (Forwarder only) Choices:
|
|
The node domain name for which this API call is intended When unspecified, the current node is used This parameter can be used only when Clustering is initialized |
|
List of primary name server IP addresses or names (Secondary, SecondaryForwarder, SecondaryCatalog, Stub) |
|
DNS transport protocol for Conditional Forwarder zone Choices:
|
|
Proxy server address (Forwarder only) |
|
Proxy server password (Forwarder only) |
|
Proxy server port (Forwarder only) |
|
Proxy type for conditional forwarding (Forwarder only) Choices:
|
|
Proxy server username (Forwarder only) |
|
The desired state of the DNS zone
Choices:
|
|
TSIG key name (Secondary, SecondaryForwarder, SecondaryCatalog) |
|
The type of zone to be created Required when Choices:
|
|
Enable using date scheme for SOA serial (Primary, Forwarder, Catalog zones) Choices:
|
|
Whether to validate SSL certificates when making API requests Choices:
|
|
Enable ZONEMD validation (Secondary only) Choices:
|
|
The domain name of the zone |
|
Zone transfer protocol (Secondary, SecondaryForwarder, SecondaryCatalog) Choices:
|
See Also
See also
- effectivelywild.technitium_dns.technitium_dns_sign_zone
Sign a zone with DNSSEC
- effectivelywild.technitium_dns.technitium_dns_get_zone_info
Get basic zone information
- effectivelywild.technitium_dns.technitium_dns_get_zone_options
Get all configured zone options
- effectivelywild.technitium_dns.technitium_dns_set_zone_options
Set zone options
- effectivelywild.technitium_dns.technitium_dns_enable_zone
Enables a zone
- effectivelywild.technitium_dns.technitium_dns_disable_zone
Disables a zone
Examples
# Basic Primary zone
- name: Ensure Primary zone exists
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "http://localhost"
api_token: "myapitoken"
zone: "example.com"
type: "Primary"
state: present
# Primary zone with DNSSEC
- name: Create Primary zone with DNSSEC enabled
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "http://localhost"
api_token: "myapitoken"
zone: "secure.example.com"
type: "Primary"
dnssec: true
state: present
# Forwarder zone
- name: Create Forwarder zone
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "http://localhost"
api_token: "myapitoken"
zone: "forward.example.com"
type: "Forwarder"
forwarder: "8.8.8.8"
initializeForwarder: true
protocol: "Udp"
state: present
# Secondary zone
- name: Create Secondary zone
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "http://localhost"
api_token: "myapitoken"
zone: "secondary.example.com"
type: "Secondary"
primaryNameServerAddresses:
- "192.0.2.1"
- "192.0.2.2"
zoneTransferProtocol: "Tcp"
state: present
# Delete a zone
- name: Ensure zone is absent
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "http://localhost"
api_token: "myapitoken"
zone: "example.com"
state: absent
# Using with loops
- name: Manage multiple DNS zones
effectivelywild.technitium_dns.technitium_dns_zone:
api_url: "https://{{ dnsserver_domain }}"
api_token: "{{ api_token }}"
zone: "{{ item.zone }}"
type: "{{ item.type }}"
state: "{{ item.state | default('present') }}"
loop: "{{ dns_zones }}"
loop_control:
label: "{{ item.zone }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
The raw response from the Technitium DNS API. Returned: always |
|
The core data payload from the API. Returned: always |
|
API response status. Returned: always Sample: |
|
A boolean indicating if the module made changes to the system. Returned: always |
|
A boolean indicating if the module failed. Returned: always |
|
A message indicating the result of the operation. Returned: always |