effectivelywild.technitium_dns.technitium_dns_query_logs module – Query logs from a specified DNS app on Technitium DNS server

Note

This module is part of the effectivelywild.technitium_dns collection (version 0.9.1).

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_query_logs.

New in effectivelywild.technitium_dns 0.9.0

Synopsis

  • Query logs from a specified DNS app with optional filtering.

  • Supports pagination and filtering by various criteria.

Parameters

Parameter

Comments

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

class_path

string / required

The class path of the DNS app

client_ip_address

string

The client IP address to filter the logs

descending_order

boolean

Orders the selected data set in descending order

Choices:

  • false

  • true

end

string

The end date time in ISO 8601 format to filter the logs

entries_per_page

integer

The number of entries per page

name

string / required

The name of the installed DNS app

page_number

integer

The page number of the data set to retrieve

protocol

string

The DNS transport protocol to filter the logs

Choices:

  • "Udp"

  • "Tcp"

  • "Tls"

  • "Https"

  • "Quic"

qclass

string

The DNS class (QCLASS) in the request question section to filter the logs

qname

string

The query name (QNAME) in the request question section to filter the logs

qtype

string

The DNS resource record type (QTYPE) in the request question section to filter the logs

rcode

string

The DNS response code to filter the logs

response_type

string

The DNS server response type to filter the logs

Choices:

  • "Authoritative"

  • "Recursive"

  • "Cached"

  • "Blocked"

  • "UpstreamBlocked"

  • "CacheBlocked"

start

string

The start date time in ISO 8601 format to filter the logs

validate_certs

boolean

Whether to validate SSL certificates when making API requests.

Choices:

  • false

  • true ← (default)

See Also

Examples

- name: Query logs from a DNS app
  technitium_dns_query_logs:
    api_url: "http://localhost"
    api_token: "myapitoken"
    name: "Query Logger"
    class_path: "QueryLogger.App"
  register: result

- debug:
    var: result.entries

- name: Query logs with filters
  technitium_dns_query_logs:
    api_url: "http://localhost"
    api_token: "myapitoken"
    name: "Query Logger"
    class_path: "QueryLogger.App"
    page_number: 1
    entries_per_page: 50
    descending_order: true
    response_type: "Blocked"
    qname: "example.com"
  register: blocked_queries

- name: Query logs for a specific time range
  technitium_dns_query_logs:
    api_url: "http://localhost"
    api_token: "myapitoken"
    name: "Query Logger"
    class_path: "QueryLogger.App"
    start: "2021-09-10 00:00:00"
    end: "2021-09-11 23:59:59"
    protocol: "Udp"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

changed

boolean

Whether the module made changes (always false for query operations)

Returned: always

Sample: false

entries

list / elements=dictionary

List of log entries

Returned: always

answer

string

DNS answer

Returned: always

Sample: "172.217.166.46"

clientIpAddress

string

Client IP address

Returned: always

Sample: "127.0.0.1"

protocol

string

DNS transport protocol

Returned: always

Sample: "Udp"

qclass

string

Query class

Returned: always

Sample: "IN"

qname

string

Query name

Returned: always

Sample: "google.com"

qtype

string

Query type

Returned: always

Sample: "A"

rcode

string

DNS response code

Returned: always

Sample: "NoError"

responseRtt

float

Response round-trip time in milliseconds (for recursive queries)

Returned: when available

Sample: 33.45

responseType

string

DNS server response type

Returned: always

Sample: "Recursive"

rowNumber

integer

Row number of the entry

Returned: always

Sample: 1

timestamp

string

Timestamp of the query

Returned: always

Sample: "2021-09-10T12:22:52Z"

failed

boolean

Whether the module failed

Returned: always

Sample: false

page_number

integer

Current page number

Returned: always

Sample: 1

total_entries

integer

Total number of entries

Returned: always

Sample: 13

total_pages

integer

Total number of pages

Returned: always

Sample: 2

Authors

  • Frank Muise (@effectivelywild)