opnsense_search_dns_queries
Search recent DNS queries logged by Unbound, filter by domain, client, or blocklist, and see blocked lookups to investigate unusual client activity or blocklist hits.
Instructions
Search recent DNS lookups seen by the Unbound resolver, including which client asked and whether the answer was blocked.
This requires Unbound's reporting to be enabled in Services -> Unbound DNS -> Reporting; without it the resolver answers queries but records nothing and this tool returns an empty result even on a busy network.
Pair this with the firewall log when a client behaves oddly: a device resolving domains it should not, or a blocklist hit the user did not expect, both show up here and in neither the rule set nor the state table.
Args: params (DnsQueriesInput): Validated input containing: - search (str): Filter on domain, client or blocklist (default: "") - blocked_only (bool): Only blocked queries (default: False) - limit (int): Max records, 1-200 (default: 25) - offset (int): Records to skip (default: 0) - response_format (ResponseFormat): 'markdown' or 'json'
Returns: str: Markdown table, or JSON with this schema: { "total": int, "count": int, "offset": int, "has_more": bool, "next_offset": int|null, "queries": [ {"time": str, "client": str, "type": str, "domain": str, "action": str, "blocklist": str, "rcode": str} ] }
Examples: - Use when: "What did this device look up?" -> search="192.168.30.57" - Use when: "Is anything hitting the blocklist?" -> blocked_only=True
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |