A Script to get all DNS IPs and show the server names they are pointing to

I need to create a script that will grab all DNS IP's, show all server names and what they are pointing to. Does anyone have any ideas? I would prefer powershell only because I have used it more but any other idea is welcome..thanks
LVL 1
Thor2923Asked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
>>output to something like C:\temp\DNS.txt

Take a look at Out-File:
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/out-file?view=powershell-6

>>the $Zone.Zonename does not seem to create anything I can find

I cannot help with that.  I don't have a DNS server I can use to test the scripts.
1
 
slightwv (䄆 Netminder) Commented:
I'm a little confused.  Are you wanting to point to a DNS server and dump everything  it knows about?

I would start with Get-DnsServerZone and then Get-DnsServerResourceRecord

There are a few examples here:
http://sigkillit.com/2015/10/27/list-all-dns-records-with-powershell/
0
 
atlas_shudderedSr. Network EngineerCommented:
If you are just trying to get a map of hostnames to IPs for a known subnet, why not just use nmap and scan the network and option for resolution?
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Thor2923Author Commented:
yes slightwv (䄆 Netminder) I am trying to get as much DNS info as possible into a report. I was in a meeting and wrote down what was said on the fly. Right now I am just getting comfortable with running the Powershell commands and learning to generate output
0
 
slightwv (䄆 Netminder) Commented:
Take a look at what is in the link I provided and see if it gets you what you need.
1
 
Thor2923Author Commented:
it appears to run but I cannot find the output. I am playing with Syntax to just get it to output to something like C:\temp\DNS.txt
do u have the proper syntax for the last line of the 3 option?  the $Zone.Zonename does not seem to create anything I can find
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.