Skip to content

Instantly share code, notes, and snippets.

@manasmbellani
Created April 15, 2025 11:13
Show Gist options
  • Select an option

  • Save manasmbellani/702dce13fcc3baddf62b923a6f388771 to your computer and use it in GitHub Desktop.

Select an option

Save manasmbellani/702dce13fcc3baddf62b923a6f388771 to your computer and use it in GitHub Desktop.
Generate Domain Generated Algorithm DNS Domain Names to trigger Defender for DNS
for($i=0; $i -le 150; $i++) {
$rand = -join ((97..122) | Get-Random -Count 32 | % {[char]$_})
Resolve-DnsName "$rand.com" -ErrorAction Ignore
}
for($i=0; $i -le 1000; $i++) {
$rand = -join ((97..122) | Get-Random -Count 63 | % {[char]$_})
Resolve-DnsName "$rand.contoso.com" -ErrorAction Ignore
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment