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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.