Link to home
Create AccountLog in
Scripting Languages

Scripting Languages

--

Questions

--

Followers

Top Experts

Avatar of amigan_99
amigan_99🇺🇸

Powershell to get a list of reverse DNS lookups.
in powershell I need a one liner that takes a list of IP addresses and outputs the IP address and the name to a file.
From technet I found something very close. (See below.) But this results in a file with only host names. Can I
modify this to get the IP and the name into the file? Thank you


Get-Content C:\IP_Address.txt | ForEach-Object {([system.net.dns]::GetHostByAddress($_)).hostname >> c:\hostname.txt}

https://gallery.technet.microsoft.com/scriptcenter/Get-Hostname-from-IP-ce61802f#content

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


EXPERT CERTIFIED SOLUTION
Avatar of Ciprian LozonschiCiprian Lozonschi🇨🇿

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

ASKER CERTIFIED SOLUTION
Avatar of amigan_99amigan_99🇺🇸

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

SOLUTION
Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of amigan_99amigan_99🇺🇸

ASKER

Thank you very much.

Glad to help!  :)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Scripting Languages

Scripting Languages

--

Questions

--

Followers

Top Experts

A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.