Listen to this Post

Introduction:
For years, cloud engineers and network operators have resorted to a costly and time-consuming ritual: deploying temporary virtual machines to run packet capture tools like Wireshark or tcpdump, solely to troubleshoot elusive DNS issues. This era of makeshift troubleshooting is over. Azure Firewall’s newly enhanced DNS Flow Trace Logs provide an integrated, powerful observability platform that captures the entire DNS resolution journey, from client query to final response, delivering unparalleled visibility directly within your security fabric.
Learning Objectives:
- Understand the architecture and data captured by Azure Firewall DNS Proxy and its new Flow Trace Logs.
- Learn how to enable DNS Proxy and configure diagnostic settings to route Flow Trace Logs to your preferred destination.
- Master the use of Kusto Query Language (KQL) to analyze DNS logs for troubleshooting, architectural validation, and security auditing.
You Should Know:
- What Are Azure Firewall DNS Flow Trace Logs?
Azure Firewall DNS Proxy acts as an intermediary for DNS requests from virtual networks. While it has long provided basic query logging, the new Flow Trace Logs deliver a comprehensive, step-by-step audit trail of a DNS transaction. This captures the entire flow: the initial client request to the firewall, the firewall’s subsequent query to an upstream DNS server (if the record wasn’t cached), and the response’s path back to the original client. This end-to-end visibility is critical for distinguishing between resolution failures, routing misconfigurations, and server errors.
Step‑by‑step guide explaining what this does and how to use it.
Core Data Points Captured: Each log entry contains the domain being queried, the query type (A, AAAA, CNAME, etc.), the response code (NOERROR, NXDOMAIN, SERVFAIL), the IP address of the upstream DNS server used, client and server IP addresses, and a critical boolean flag indicating whether the response was served from the Azure Firewall’s cache.
The Big Picture: This transforms DNS from a “black box” into a transparent, debuggable system. You can now conclusively answer questions like, “Was the query forwarded to my on-premises DNS server as intended?” or “Did this failure occur because the upstream server was unreachable or because the record simply doesn’t exist?”
2. Enabling DNS Proxy and Flow Trace Logging
Before you can leverage these logs, you must configure Azure Firewall to act as a DNS Proxy and then enable the diagnostic settings for the new log category.
Step‑by‑step guide explaining what this does and how to use it.
1. Enable DNS Proxy on Azure Firewall Policy:
Navigate to your Azure Firewall Policy in the Azure portal.
Under Settings, select DNS Settings.
Set DNS Proxy to Enabled.
(Optional) Configure custom DNS servers. If left blank, it will use Azure’s built-in resolvers.
2. Configure Virtual Network DNS Settings:
For any VNet that should use the firewall for DNS, you must update its DNS server settings.
Go to your Virtual Network -> Settings -> DNS servers.
Select Custom and enter the private IP address of your Azure Firewall.
3. Enable DNS Flow Trace Logs via Diagnostic Settings:
In your Firewall Policy, go to Monitoring -> Diagnostic settings.
Click Add diagnostic setting.
Provide a name (e.g., “dns-flow-logs”).
Under Category groups, select AllLogs or specifically check AzureFirewallDnsFlow.
Send the logs to a destination like a Log Analytics Workspace for querying.
3. Querying and Analyzing DNS Logs with KQL
The true power of Flow Trace Logs is unlocked in a Log Analytics Workspace using Kusto Query Language (KQL). This allows you to move from raw data to actionable intelligence.
Step‑by‑step guide explaining what this does and how to use it.
Basic Query to See All Recent DNS Logs:
AzureDiagnostics | where Category == "AzureFirewallDnsFlow" | project TimeGenerated, msg_s, srcIp_s, dstIp_s, query_s, queryType_s, responseCode_s, upstreamServer_s, cacheHit_s | sort by TimeGenerated desc
This query retrieves all DNS flow events, projecting key columns and sorting by the most recent.
Troubleshooting Failed Resolutions:
AzureDiagnostics | where Category == "AzureFirewallDnsFlow" | where responseCode_s != "NOERROR" | project TimeGenerated, srcIp_s, query_s, queryType_s, responseCode_s, upstreamServer_s
This filters for failed DNS responses (like NXDOMAIN for non-existent domains or SERVFAIL for server failures), helping you quickly identify misconfigured applications or problematic upstream servers.
Auditing Cache Usage and Upstream Servers:
AzureDiagnostics | where Category == "AzureFirewallDnsFlow" | summarize Count = count() by bin(TimeGenerated, 1h), query_s, cacheHit_s, upstreamServer_s | order by Count desc
This query summarizes query volume, showing which domains are most frequently requested and whether they are being served from cache, which is vital for performance tuning and validating DNS architecture.
4. Practical Use Case: Debugging Application Connectivity Issues
A common scenario is an application suddenly failing to connect to a backend service. The error might be vague, like “Unable to resolve host.” Flow Trace Logs provide a definitive root cause analysis.
Step‑by‑step guide explaining what this does and how to use it.
1. Identify the Application VM: Note the source IP of the troubled application.
2. Craft a Targeted KQL Query:
AzureDiagnostics | where Category == "AzureFirewallDnsFlow" | where srcIp_s == "<Application_VM_IP>" | where query_s contains "your-backend-service.com" | project TimeGenerated, responseCode_s, upstreamServer_s, cacheHit_s
3. Analyze the Result: If `responseCode_s` shows “NXDOMAIN”, the domain name is incorrect. If it shows “SERVFAIL”, the configured upstream DNS server is failing to provide a valid answer. This instantly directs your troubleshooting efforts, eliminating guesswork.
5. Securing Your Environment with DNS Audit Logs
From a security perspective, DNS logs are a goldmine for detecting anomalous behavior, data exfiltration attempts, and communication with malicious domains.
Step‑by‑step guide explaining what this does and how to use it.
Baseline Normal DNS Traffic: Use the summarization queries from section 3 to understand your typical DNS patterns—what domains are queried, from which sources, and at what volume.
Hunt for Anomalies:
AzureDiagnizations | where Category == "AzureFirewallDnsFlow" | where responseCode_s == "NOERROR" | summarize QueryCount = count() by srcIp_s, bin(TimeGenerated, 15m) | where QueryCount > 1000 // Adjust threshold based on your baseline
This query identifies potential DNS flood attacks or data exfiltration via DNS tunneling by flagging sources generating an abnormally high volume of successful queries in a short time frame.
Integrate with Threat Intelligence: For a more advanced security posture, you can export these logs to a SIEM like Microsoft Sentinel and correlate the `query_s` field with custom or commercial threat intelligence feeds to flag queries to known malicious domains.
What Undercode Say:
- The Death of the Troubleshooting VM: This feature fundamentally shifts cloud network operations, rendering the practice of deploying temporary VMs for packet capture obsolete for DNS issues. It represents a maturation of cloud-native services, moving from basic connectivity to deep, integrated observability.
- Unified Security and Operations Visibility: By embedding this capability within the firewall, Microsoft is blurring the lines between NetOps and SecOps. The firewall is no longer just a policy enforcement point; it is becoming the central data plane observability hub for the network, providing a single pane of glass for both troubleshooting and threat hunting.
The introduction of DNS Flow Trace Logs is a strategic move that reduces operational overhead and “time-to-resolution” while simultaneously enhancing security postures. It encourages a best-practice architecture where the firewall is the central DNS egress point, simplifying management and maximizing visibility. This is a clear indicator of the industry’s direction: leveraging platform-native services to automate and streamline traditional, manual IT tasks.
Prediction:
The release of DNS Flow Trace Logs signifies a broader industry trend where core cloud security services will increasingly absorb advanced networking and observability functions. We predict that within two years, features like this will become the standard baseline for all major cloud firewall offerings. Furthermore, this deep data layer will be directly integrated with AIOps and SIEM platforms, enabling predictive anomaly detection and automated remediation for network and security incidents, moving cloud management from a reactive to a proactive and ultimately a predictive model.
🎯Let’s Practice For Free:
IT/Security Reporter URL:
Reported By: Matthansen0 Azure – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


