![dns forward and reverse lookup dns forward and reverse lookup](https://i.ytimg.com/vi/7KN-_IWs7hk/maxresdefault.jpg)
$script:DNS_IN_BOTH = $PSScriptRoot '\Output\DNS_IN_BOTH.csv' #Will contain records that exists in both FORWARD AND REVERSE zones $script:DNS_REV_Object = $PSScriptRoot '\Output\DNS_REV_OBJ.csv' #Will contain all NAMES and IPs from the REV lookup zone $script:DNS_FWD_Duplicates = $PSScriptRoot '\Output\DNS_FWD_Duplicates.csv' #Will contain records from the FORWARD lookup zone that have more than one IP $script:DNS_FWD_Object = $PSScriptRoot '\Output\DNS_FWD_OBJ.csv' #Will contain all NAMES and IPs from the FWD lookup zone $script:DomainController = $script:DomainController -Replace -Replace '}','' #Remove crap from the DC variable $script:DomainController = Get-ADDomainController | Select HostName #Check which DC is the closest. #Declaring the variables that needs to be accessible from within different functions of the script #It will retrieve information from both the forward lookup zone and all reverse lookup zones. This script will be used to retrieve and compare information from the DNS.
#DNS FORWARD AND REVERSE LOOKUP HOW TO#
If anyone have any recommendations on how to make the script better please let me know and if there are any questions just shout. It is the first script I publish for others to use so I hope that the comments are sufficient :) I couldn't find any thread touching that topic so I wrote a script and decided to share it here if someone else is in the same situation. Now, I ran into a situation where I wanted to inventories and compare our STATIC A records in the forward lookup zone towards the STATIC PTR records in ALL of our reverse lookup zones in our DNS because we noticed that we had inconsistency and to many records to even think of doing it manually. I have been scrolling through this subreddit for quite some time and there is A LOT of helpful threads in here, you guys are amazing!
- Research Triangle Powershell User Group remote-capable.
-
Philadelphia PowerShell User Group remote-capable.Madison Power Users Group remote-capable.Denver Microsoft Enterprise Management User Group.NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
#DNS FORWARD AND REVERSE LOOKUP WINDOWS#
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft.
Submission Guidelines | Link Flair - How To