Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 9. Network observability DNS resolution analysis
Learn how DNS resolution analysis uses eBPF-based decoding to identify service discovery issues and follow the steps to enable DNS tracking in the FlowCollector resource to enrich network flow records with domain names.
9.1. Strategic benefits of DNS resolution analysis Link kopierenLink in die Zwischenablage kopiert!
Use DNS resolution analysis to differentiate between network transport failures and service discovery issues by enriching eBPF flow records with domain names and status codes.
Standard flow logs only show that traffic occurred on port 53. DNS resolution analysis allows you to complete the following tasks:
-
Reduced Mean time to identify (Mtti): Distinguish immediately between a network routing failure and a DNS resolution failure, such as an
NXDOMAINerror. -
Measure internal service latency: Track the time it takes for CoreDNS to respond to specific internal lookups (e.g.,
my-service.namespace.svc.cluster.local). - Audit external dependencies: Audit which external APIs or third-party domains your workloads are communicating with without requiring sidecars or manual packet captures.
- Improved security posture: Detect potential data exfiltration or Command and Control (C2) activity by auditing the Fully Qualified Domain Names (FQDNs) queried by internal workloads.
9.1.1. DNS flow enrichment Link kopierenLink in die Zwischenablage kopiert!
When this feature is active, the eBPF agent enriches the flow records. This metadata allows you to group and filter traffic by the intent of the connection (the domain) rather than just the source IP.
Enhanced DNS decoding allows the eBPF agent to inspect UDP and TCP DNS traffic on port 53 along with the query names for the DNS request.
9.2. Configure DNS domain tracking for network observability Link kopierenLink in die Zwischenablage kopiert!
Enable DNS tracking in the Network Observability Operator to monitor DNS query names, response codes, and latency for network flows within the cluster.
Prerequisites
- The Network Observability Operator is installed.
-
You have
cluster-adminprivileges. -
You are familiar with the
FlowCollectorcustom resource.
Procedure
Edit the
FlowCollectorresource by running the following command:$ oc edit flowcollector clusterConfigure the eBPF agent to enable the DNS tracking feature:
apiVersion: flows.netobserv.io/v1alpha1 kind: FlowCollector metadata: name: cluster spec: agent: type: eBPF ebpf: features: - DNSTrackingwhere:
spec.agent.type.ebpf.features-
Specifies the list of features to enable for the eBPF agent. To enable DNS tracking, add
DNSTrackingto this list.
- Save and exit the editor.
Verification
-
In the OpenShift Container Platform web console, navigate to Observe
Network Traffic. - In the Traffic Flows view, click the Manage columns icon.
- Ensure that the DNS Query Name, DNS Response Code, and DNS Latency columns are selected.
-
Filter the results by setting Port to
53. - Confirm that the flow table columns are populated with domain names and DNS metadata.
9.3. DNS flow enrichment and analysis reference Link kopierenLink in die Zwischenablage kopiert!
Identify metadata added to network flows, leverage DNS data for network optimization, and understand the performance and storage impacts on the cluster.
The following table describes the metadata fields added to network flows when DNS tracking is enabled.
Query names might be missing or truncated because of compression pointers or cache limitations.
| Field | Description | Example |
|---|---|---|
|
| The Fully Qualified Domain Name (FQDN) being queried. |
|
|
| The status code returned by the DNS server. |
|
|
| The transaction ID used to match queries with responses. |
|
9.3.1. Leverage DNS data for network optimization Link kopierenLink in die Zwischenablage kopiert!
Use the captured DNS metadata for the following operational outcomes:
- Audit external dependencies: Ensure workloads are not reaching out to unauthorized external APIs or high-risk domains.
-
Performance tuning: Monitor
DNS Latencyto identify ifCoreDNSpods require additional scaling or if upstream DNS providers are lagging.
9.3.2. Identify misconfiguration errors Link kopierenLink in die Zwischenablage kopiert!
A high frequency of NXDOMAIN responses typically indicates service discovery errors in application code or stale environment variables.
NXDOMAIN errors can be frequent in Kubernetes because of DNS searches on services and pods. While these results do not necessarily indicate a misconfiguration or broken URL, they can negatively impact performance.
When NXDOMAIN errors are returned despite an apparently valid Service or Pod host name, such as my-svc.my-namespace.svc, the resolver is likely configured to query DNS for different suffixes. You can optimize this by adding a trailing dot to fully qualified domain names to tell the resolver that the name is unambiguous.
For example, instead of https://my-svc.my-namespace.svc, use https://my-svc.my-namespace.svc.cluster.local. with a trailing dot.
9.3.3. Loki storage considerations Link kopierenLink in die Zwischenablage kopiert!
DNS tracking increases the number of labels and the amount of metadata per flow. Ensure that the Loki storage is sized to accommodate the increased log volume.