2020-06-11 16:15:23 +02:00
|
|
|
#!/snap/bin/powershell
|
|
|
|
#
|
2020-06-15 14:55:54 +02:00
|
|
|
# Description: trains the DNS cache with frequently used domain names
|
|
|
|
# Author: Markus Fleschutz
|
|
|
|
# Source: github.com/fleschutz/PowerShell
|
|
|
|
# License: CC0
|
|
|
|
#
|
2020-06-11 18:20:40 +02:00
|
|
|
$DomainTable = import-csv domain_table.csv
|
2020-06-11 16:15:23 +02:00
|
|
|
|
|
|
|
foreach($Row in $DomainTable) {
|
|
|
|
$DomainName = $Row.Domain
|
2020-06-12 23:05:06 +02:00
|
|
|
write-progress "Training DNS cache with $DomainName ..."
|
|
|
|
$Ignore = Resolve-DnsName -Name $DomainName -DnsOnly
|
2020-06-11 16:15:23 +02:00
|
|
|
}
|
2020-06-11 18:20:40 +02:00
|
|
|
|
|
|
|
$Count = $DomainTable.Length
|
|
|
|
write-host "OK - trained DNS cache with $Count domain names from domain_table.csv"
|
2020-06-11 16:15:23 +02:00
|
|
|
exit 0
|