Change the path of $list to the path of your text file with the domains. The domains need to be one per line in the text file. Change the?$exportPath to where you want to save the CSV file. Then copy and paste the code below into a .ps1 file and run from PowerShell.
$list = “C:\meh\Domains.txt”
$exportPath = “C:\meh\meh.csv”
$apps = get-content $list$nsresults = @()
foreach ($app in $apps) {
$nsresults += Resolve-DnsName -Type 2 -Name $app | select -first 1 Name, NameHost
}
$nsresults
$nsresults | Export-Csv -Path $exportPath