I'm actually zero to Powershell scripting, but I need to write one, to go through a .txt file with ip-adresses wrote in one per line and run nslookup for each adress to get it's hostname and write it in file (or get an error message if there is no DNS record for used IP).

I found this topic this almost the same task: [Getting IP addresses for hostnames using nslookup in Powershell](https://stackoverflow.com/questions/18102227/getting-ip-addresses-for-hostnames-using-nslookup-in-powershell)

so I need a similar solution, but using IP-adresses as input to get hostnames (or error message) in output.

Does anyone able to help me?

Thank you.