← Back to SOC feed Coverage →

Device Count by DNS Suffix

kql MEDIUM Azure-Sentinel
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-22T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use a shared DNS suffix across multiple devices to mask lateral movement or command-and-control communications. SOC teams should proactively hunt for this behavior to identify potential coordinated attacks or compromised device groups within their Azure Sentinel environment.

KQL Query

DeviceInfo
| where isnotempty(OSPlatform)
| summarize arg_max(Timestamp, DeviceName) by DeviceId
| extend DeviceMachineName = split(DeviceName, '.')[0]
| extend DeviceDomain = substring(DeviceName, strlen(DeviceMachineName) + 1, strlen(DeviceName) - strlen(DeviceMachineName) - 1)
| summarize count() by DeviceDomain

Analytic Rule Definition

id: fcd06834-86f9-43ce-817a-b5104ef279e0
name: Device Count by DNS Suffix
description: |
  This query will count the number of devices in Defender ATP based
  on their DNS suffix.  For a full list of devices with the DNS
  suffix, comment out or remove the last line.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceInfo
query: |
  DeviceInfo
  | where isnotempty(OSPlatform)
  | summarize arg_max(Timestamp, DeviceName) by DeviceId
  | extend DeviceMachineName = split(DeviceName, '.')[0]
  | extend DeviceDomain = substring(DeviceName, strlen(DeviceMachineName) + 1, strlen(DeviceName) - strlen(DeviceMachineName) - 1)
  | summarize count() by DeviceDomain

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/General queries/Device Count by DNS Suffix.yaml