effectivelywild.technitium_dns.technitium_dns_delete_record module – Delete a DNS record
Note
This module is part of the effectivelywild.technitium_dns collection (version 0.4.0).
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_delete_record
.
New in effectivelywild.technitium_dns 0.1.0
Synopsis
Delete a a DNS record to a Technitium DNS zone.
You must include the record parameters when deleting a record.
The module supports all DNS record types.
Some parameters are only valid or required for specific record types.
For example,
ipAddress
is required for A and AAAA records, whilecname
is required for CNAME records.
Parameters
Parameter |
Comments |
---|---|
Algorithm (DS only) Choices:
|
|
ANAME target (ANAME only) |
|
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 |
|
Application name (APP only) |
|
Automatic IPv4 hint (SVCB and HTTPS only) Choices:
|
|
Automatic IPv6 hint (SVCB and HTTPS only) Choices:
|
|
Class path (APP only) |
|
CNAME target (CNAME only) |
|
Comments for the record |
|
Create reverse zone for PTR (A/AAAA only) Choices:
|
|
Digest (DS and SSHFP only) |
|
Digest type (DS and SSHFP only) Choices:
|
|
DNAME target (DNAME only) |
|
DNSSEC validation flag (FWD only) Choices:
|
|
MX exchange domain (MX only) |
|
Expiry in seconds for auto-deletion |
|
Flags (CAA only) |
|
Forwarder address (FWD only) |
|
Forwarder priority (FWD only) |
|
Glue address (NS only) |
|
IP address (A/AAAA only) |
|
Key tag (DS only) |
|
Responsible mailbox (MX only) |
|
The record name (e.g., test.example.com) The use of domain is also supported to align with API |
|
Name server domain (NS only) |
|
Flags (NAPTR only) |
|
Order (NAPTR only) |
|
Preference (NAPTR only) |
|
Regular expression (NAPTR only) |
|
Replacement string (NAPTR only) |
|
Services (NAPTR only) |
|
Overwrite existing record set for this type Choices:
|
|
MX preference (MX only) |
|
Priority (SRV only) |
|
Protocol (FWD only) Choices:
|
|
Proxy address (FWD only) |
|
Proxy password (FWD only) |
|
Proxy port (FWD only) |
|
Proxy type (FWD only) Choices:
|
|
Proxy username (FWD only) |
|
Add reverse PTR record (A/AAAA only) Choices:
|
|
PTR domain name (PTR only) |
|
Used for adding unknown i.e. unsupported record types (UNKNOWN Only) The value must be formatted as a hex string or a colon separated hex string |
|
Record data (APP only) |
|
Split TXT into multiple strings (TXT only) Choices:
|
|
Port (SRV only) |
|
SSHFP algorithm (SSHFP only) Choices:
|
|
SSHFP fingerprint (SSHFP only) |
|
SSHFP fingerprint type (SSHFP only) Choices:
|
|
SVCB/HTTPS parameters (SVCB and HTTPS only) |
|
SVCB/HTTPS priority (SVCB and HTTPS only) |
|
SVCB/HTTPS target name (SVCB and HTTPS only) |
|
Tag (CAA only) |
|
Target (SRV only) |
|
TXT record text (TXT only) |
|
TLSA certificate association data (TLSA only) |
|
TLSA certificate usage (TLSA only) Choices:
|
|
TLSA matching type (TLSA only) Choices:
|
|
TLSA selector (TLSA only) Choices:
|
|
TTL for the record in seconds |
|
Domain for TXT record (if different from the main domain, TXT only) |
|
The DNS record type Choices:
|
|
Update SVCB/HTTPS hints (A/AAAA only) Choices:
|
|
URI target (URI only) |
|
URI priority (URI only) |
|
URI weight (URI only) |
|
Whether to validate SSL certificates when making API requests Set to false to disable SSL certificate validation Choices:
|
|
Value (CAA only) |
|
Weight (SRV only) |
|
The authoritative zone name (optional, defaults to closest match) |
See Also
See also
- effectivelywild.technitium_dns.technitium_dns_add_record
Used to add DNS records
- effectivelywild.technitium_dns.technitium_dns_get_record
Used to get DNS record details
Examples
# Basic A record deletion
- name: Delete an A record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "www.example.com"
type: "A"
ipAddress: "192.0.2.1"
# AAAA (IPv6) record deletion
- name: Delete an AAAA record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "ipv6.example.com"
type: "AAAA"
ipAddress: "2001:db8::1"
# CNAME record deletion
- name: Delete a CNAME record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "alias.example.com"
type: "CNAME"
cname: "www.example.com"
# MX record deletion
- name: Delete an MX record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "example.com"
type: "MX"
exchange: "mail.example.com"
preference: 10
# TXT record deletion
- name: Delete a TXT record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "example.com"
type: "TXT"
text: "v=spf1 include:_spf.google.com ~all"
# SRV record deletion
- name: Delete an SRV record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "_sip._tcp.example.com"
type: "SRV"
priority: 10
weight: 20
srv_port: 5060
target: "sip.example.com"
# NS record deletion
- name: Delete an NS record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "subdomain.example.com"
type: "NS"
nameServer: "ns1.subdomain.example.com"
# PTR record deletion
- name: Delete a PTR record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "1.2.0.192.in-addr.arpa"
type: "PTR"
ptrName: "www.example.com"
# CAA record deletion
- name: Delete a CAA record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "example.com"
type: "CAA"
flags: 0
tag: "issue"
value: "letsencrypt.org"
# ANAME record deletion
- name: Delete an ANAME record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "example.com"
type: "ANAME"
aname: "target.example.net"
# SSHFP record deletion
- name: Delete an SSHFP record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "server.example.com"
type: "SSHFP"
sshfpAlgorithm: 1
sshfpFingerprintType: 1
sshfpFingerprint: "123456789abcdef67890123456789abcdef67890"
# HTTPS record deletion
- name: Delete an HTTPS record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "example.com"
type: "HTTPS"
svcPriority: 1
svcTargetName: "svc.example.com"
svcParams: "alpn=h2,h3"
# SVCB record deletion
- name: Delete an SVCB record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "_svc.example.com"
type: "SVCB"
svcPriority: 1
svcTargetName: "svc.example.com"
svcParams: "port=443"
# TLSA record deletion
- name: Delete a TLSA record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "_443._tcp.example.com"
type: "TLSA"
tlsaCertificateUsage: 3
tlsaSelector: 1
tlsaMatchingType: 1
tlsaCertificateAssociationData: "abcdef1234567890abcdef1234567890abcdef12"
# URI record deletion
- name: Delete a URI record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "_http._tcp.example.com"
type: "URI"
uriPriority: 10
uriWeight: 1
uri: "https://example.com/path"
# DS record deletion
- name: Delete a DS record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "secure.example.com"
type: "DS"
keyTag: 12345
algorithm: 7
digestType: 1
digest: "abcdef1234567890abcdef1234567890abcdef1234567890"
# DNAME record deletion
- name: Delete a DNAME record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "old.example.com"
type: "DNAME"
dname: "new.example.com"
# FWD record deletion
- name: Delete a FWD record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "forward.example.com"
type: "FWD"
protocol: "Udp"
forwarder: "8.8.8.8"
forwarderPriority: 1
# APP record deletion
- name: Delete an APP record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "app.example.com"
type: "APP"
appName: "MyApp"
classPath: "com.example.MyApp"
recordData: "config=production"
# NAPTR record deletion
- name: Delete a NAPTR record
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "enum.example.com"
type: "NAPTR"
naptrOrder: 100
naptrPreference: 10
naptrFlags: "u"
naptrServices: "E2U+sip"
naptrRegexp: "!^.*$!sip:user@example.com!"
naptrReplacement: "."
# Using custom port and HTTPS
- name: Delete record using custom API port and HTTPS
technitium_dns_delete_record:
api_url: "https://dns.example.com"
api_port: 8443
api_token: "myapitoken"
name: "secure.example.com"
type: "A"
ipAddress: "192.0.2.50"
validate_certs: true
# Using zone parameter
- name: Delete record with explicit zone
technitium_dns_delete_record:
api_url: "http://localhost"
api_token: "myapitoken"
name: "sub.domain.example.com"
zone: "example.com"
type: "A"
ipAddress: "192.0.2.75"
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, will be empty “[]”. Returned: always |
|
The status of the API request. Returned: always |
|
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 |