Turn it on
Three runtime settings control it. Each applies live, no restart. Under Settings, search fordns.query_log, or use the API or CLI settings commands.
Each has an environment seed (
LEVELRAIL_DNS_QUERY_LOG_ENABLED, LEVELRAIL_DNS_QUERY_LOG_SIZE, LEVELRAIL_DNS_QUERY_LOG_PRIVACY, LEVELRAIL_DNS_QUERY_LOG_APP_REFRESH) that only sets the first value. A saved setting wins.
Privacy levels
The level is applied before a record is stored, so lowering it never leaves older detail behind in new records.full: source IP, app, name, type, response code, answer count, latency and reason.names_only: the same without the source IP.counters_only: no records at all, only the per-app counters.
What a record holds
Each record has a time, the app the source container belongs to (empty when the source is not a known app container), the name, the query type, the response code, the answer count, latency in microseconds and a reason:local_record: answered from a mesh record.no_such_app: the name is in the mesh zone but nothing serves it.no_data: the name exists but has no record of the asked type (for example AAAA).refused: the name is outside the mesh zone.format_error: the query was malformed.
CLI
--qname takes a name prefix. --since takes a duration such as 15m or an RFC 3339 time. The limit is capped at the log size ceiling.
API
GET /api/v1/dns/queries takes app, qname (prefix), rcode, since and limit, and returns newest first. GET /api/v1/dns/stats returns counters per app and a total. Both need the read ability and report enabled: false while the setting is off. See the API reference.
Limits
- Queries from containers only get an app name when the mesh server is reachable from them, which today needs it bound to port 53.
- Counters reset on restart.
- This is visibility only. Nothing is blocked or rewritten.