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, while cname is required for CNAME records.

Parameters

Parameter

Comments

algorithm

string

Algorithm (DS only)

Choices:

  • "RSAMD5"

  • "DSA"

  • "RSASHA1"

  • "DSA-NSEC3-SHA1"

  • "RSASHA1-NSEC3-SHA1"

  • "RSASHA256"

  • "RSASHA512"

  • "ECC-GOST"

  • "ECDSAP256SHA256"

  • "ECDSAP384SHA384"

  • "ED25519"

  • "ED448"

aname

string

ANAME target (ANAME only)

api_port

integer

Port for the Technitium DNS API. Defaults to 5380

Default: 5380

api_token

string / required

API token for authenticating with the Technitium DNS API

api_url

string / required

Base URL for the Technitium DNS API

appName

string

Application name (APP only)

autoIpv4Hint

boolean

Automatic IPv4 hint (SVCB and HTTPS only)

Choices:

  • false

  • true

autoIpv6Hint

boolean

Automatic IPv6 hint (SVCB and HTTPS only)

Choices:

  • false

  • true

classPath

string

Class path (APP only)

cname

string

CNAME target (CNAME only)

comments

string

Comments for the record

createPtrZone

boolean

Create reverse zone for PTR (A/AAAA only)

Choices:

  • false

  • true

digest

string

Digest (DS and SSHFP only)

digestType

string

Digest type (DS and SSHFP only)

Choices:

  • "SHA1"

  • "SHA256"

  • "GOST-R-34-11-94"

  • "SHA384"

dname

string

DNAME target (DNAME only)

dnssecValidation

boolean

DNSSEC validation flag (FWD only)

Choices:

  • false

  • true

exchange

string

MX exchange domain (MX only)

expiryTtl

integer

Expiry in seconds for auto-deletion

flags

string

Flags (CAA only)

forwarder

string

Forwarder address (FWD only)

forwarderPriority

integer

Forwarder priority (FWD only)

glue

string

Glue address (NS only)

ipAddress

string

IP address (A/AAAA only)

keyTag

integer

Key tag (DS only)

mailbox

string

Responsible mailbox (MX only)

name

aliases: domain

string / required

The record name (e.g., test.example.com)

The use of domain is also supported to align with API

nameServer

string

Name server domain (NS only)

naptrFlags

string

Flags (NAPTR only)

naptrOrder

integer

Order (NAPTR only)

naptrPreference

integer

Preference (NAPTR only)

naptrRegexp

string

Regular expression (NAPTR only)

naptrReplacement

string

Replacement string (NAPTR only)

naptrServices

string

Services (NAPTR only)

overwrite

boolean

Overwrite existing record set for this type

Choices:

  • false ← (default)

  • true

preference

integer

MX preference (MX only)

priority

integer

Priority (SRV only)

protocol

string

Protocol (FWD only)

Choices:

  • "Udp"

  • "Tcp"

  • "Tls"

  • "Https"

  • "Quic"

proxyAddress

string

Proxy address (FWD only)

proxyPassword

string

Proxy password (FWD only)

proxyPort

integer

Proxy port (FWD only)

proxyType

string

Proxy type (FWD only)

Choices:

  • "NoProxy"

  • "DefaultProxy"

  • "Http"

  • "Socks5"

proxyUsername

string

Proxy username (FWD only)

ptr

boolean

Add reverse PTR record (A/AAAA only)

Choices:

  • false

  • true

ptrName

string

PTR domain name (PTR only)

rdata

string

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

recordData

string

Record data (APP only)

splitText

boolean

Split TXT into multiple strings (TXT only)

Choices:

  • false

  • true

srv_port

integer

Port (SRV only)

sshfpAlgorithm

string

SSHFP algorithm (SSHFP only)

Choices:

  • "RSA"

  • "DSA"

  • "ECDSA"

  • "Ed25519"

  • "Ed448"

sshfpFingerprint

string

SSHFP fingerprint (SSHFP only)

sshfpFingerprintType

string

SSHFP fingerprint type (SSHFP only)

Choices:

  • "SHA1"

  • "SHA256"

svcParams

string

SVCB/HTTPS parameters (SVCB and HTTPS only)

svcPriority

integer

SVCB/HTTPS priority (SVCB and HTTPS only)

svcTargetName

string

SVCB/HTTPS target name (SVCB and HTTPS only)

tag

string

Tag (CAA only)

target

string

Target (SRV only)

text

string

TXT record text (TXT only)

tlsaCertificateAssociationData

string

TLSA certificate association data (TLSA only)

tlsaCertificateUsage

string

TLSA certificate usage (TLSA only)

Choices:

  • "PKIX-TA"

  • "PKIX-EE"

  • "DANE-TA"

  • "DANE-EE"

tlsaMatchingType

string

TLSA matching type (TLSA only)

Choices:

  • "Full"

  • "SHA2-256"

  • "SHA2-512"

tlsaSelector

string

TLSA selector (TLSA only)

Choices:

  • "Cert"

  • "SPKI"

ttl

integer

TTL for the record in seconds

txtDomain

string

Domain for TXT record (if different from the main domain, TXT only)

type

string / required

The DNS record type

Choices:

  • "A"

  • "AAAA"

  • "ANAME"

  • "APP"

  • "CNAME"

  • "CAA"

  • "DNAME"

  • "DS"

  • "FWD"

  • "HTTPS"

  • "MX"

  • "NAPTR"

  • "NS"

  • "PTR"

  • "SSHFP"

  • "SRV"

  • "SVCB"

  • "TLSA"

  • "TXT"

  • "UNKNOWN"

  • "URI"

updateSvcbHints

boolean

Update SVCB/HTTPS hints (A/AAAA only)

Choices:

  • false

  • true

uri

string

URI target (URI only)

uriPriority

integer

URI priority (URI only)

uriWeight

integer

URI weight (URI only)

validate_certs

boolean

Whether to validate SSL certificates when making API requests

Set to false to disable SSL certificate validation

Choices:

  • false

  • true ← (default)

value

string

Value (CAA only)

weight

integer

Weight (SRV only)

zone

string

The authoritative zone name (optional, defaults to closest match)

See Also

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

api_response

dictionary

The raw response from the Technitium DNS API.

Returned: always

response

dictionary

The core data payload from the API, will be empty “[]”.

Returned: always

status

string

The status of the API request.

Returned: always

changed

boolean

A boolean indicating if the module made changes to the system.

Returned: always

failed

boolean

A boolean indicating if the module failed.

Returned: always

msg

string

A message indicating the result of the operation.

Returned: always

Authors

  • Frank Muise (@effectivelywild)