mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-31 19:26:27 +02:00
20 lines
535 B
PowerShell
Executable File
20 lines
535 B
PowerShell
Executable File
#!/snap/bin/powershell
|
|
#
|
|
# PowerShell Script to Train the DNS Cache
|
|
# ----------------------------------------
|
|
# Author: Markus Fleschutz
|
|
# Source: github.com/fleschutz/PowerShell
|
|
# License: CC0
|
|
|
|
$DomainTable = import-csv domain_table.csv
|
|
|
|
foreach($Row in $DomainTable) {
|
|
$DomainName = $Row.Domain
|
|
write-progress "Training DNS cache with $DomainName ..."
|
|
$Ignore = Resolve-DnsName -Name $DomainName -DnsOnly
|
|
}
|
|
|
|
$Count = $DomainTable.Length
|
|
write-host "OK - trained DNS cache with $Count domain names from domain_table.csv"
|
|
exit 0
|