32 C
Ahmedabad
Friday, July 4, 2025

Powershell – DNS resolution for multiple hostnames

We can DNS resolve multiple hostnames at a time by following a simple powershell command

 

Step 1:

    Create a simple text file and add all hostnames in the file one after another in each row

Step 2:

    Get-Content “Path of the text file” | foreach {nslookup $_} >> “path to save the output as text or csv file”

—————————————————————————————————————————

Input file : nslookupinput.txt

 

sky.com

edfenergy.com

 

espn.com

—————————————————————————————————————————

output file: nslookupoutput.txt

 

Server:  UnKnown

Address:  fd2d:ed7b:c050:0:a2bd:cdff:fe54:8188

 

Name:    sky.com

Address:  90.216.128.5

 

Server:  UnKnown

Address:  fd2d:ed7b:c050:0:a2bd:cdff:fe54:8188

 

Name:    edfenergy.com

Addresses:  13.248.135.164

  76.223.7.31

 

Server:  UnKnown

Address:  fd2d:ed7b:c050:0:a2bd:cdff:fe54:8188

 

Name:    espn.com

Addresses:  2600:9000:2111:6000:d:ac18:e2c0:93a1

  2600:9000:2111:200:d:ac18:e2c0:93a1

  2600:9000:2111:2a00:d:ac18:e2c0:93a1

  2600:9000:2111:1000:d:ac18:e2c0:93a1

  2600:9000:2111:8000:d:ac18:e2c0:93a1

  2600:9000:2111:5800:d:ac18:e2c0:93a1

  2600:9000:2111:7000:d:ac18:e2c0:93a1

  2600:9000:2111:7e00:d:ac18:e2c0:93a1

  99.86.113.111

  99.86.113.125

  99.86.113.16

  99.86.113.31

———————————————————————————————–

Author

  • Versatile result oriented professional with 12+ years of experience in Consulting, design, Implementation & support in the domain of Cloud Computing(Azure), End User Computing Virtualization ( DaaS , VDI, Citrix, VMware, Nutanix ), Datacenter and security technologies

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest posts