Changed to use nslookup

This commit is contained in:
Markus Fleschutz 2020-06-18 17:26:49 +00:00
parent 52c1b4035a
commit 022f9ff51d

View File

@ -1,18 +1,19 @@
#!/snap/bin/powershell
#
# Syntax: train_dns_cache
# Description: trains the DNS cache with frequently used domain names
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
$DomainTable = import-csv domain_table.csv
$Table = 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
foreach($Row in $Table) {
$Domain = $Row.Domain
write-progress "Training DNS cache with $Domain ..."
$Ignore = nslookup $Domain
}
$Count = $DomainTable.Length
$Count = $Table.Length
write-host "OK - trained DNS cache with $Count domain names from domain_table.csv"
exit 0