Create .BAT File that removes list or "A" records or "PTR" records for multiple DNS server

Cancelled Posted 7 years ago Paid on delivery
Cancelled Paid on delivery

I need a PowerShell script created.. Fast!! I'm fixing an issue for a client right now and few things are broken until I remove these records. I have a list of 200 PTR entries.

NOTE: This should be a simple process for someone that has the skills and should not take much time.

REM ======== Batch File Beginning ===========

@echo on

set cachedentry=123.1.168.192.in-addr.arpa.

del [login to view URL]

for /f %%i in ([login to view URL]) do (dnscmd %%i /recorddelete /cache %cachedentry% PTR /f) >> [login to view URL]

REM ====== Batch File Ending ==============

I need this batch file modified to accept multiple records like "123.1.168.192.in-addr.arpa."

They will be many records but one per line. So for each record the way it is hard coded will only delete one record. Then there is the "[login to view URL]" that has 20 or so IP's for the DNS servers to delete the record from. So I need an input file called "[login to view URL]" that will contain multiple PTR records that will need to be delete from each of the 20 servers.

In the end I should have two input files. One for the DNS server IP's and another input file for the record to be deleted.

Example ([login to view URL])

[login to view URL]

[login to view URL]

Example ([login to view URL])

101.1.168.192.in-addr.arpa.

102.1.168.192.in-addr.arpa.

So in this example it should go to the PTR txt file and delete the first entry from all the DNS servers in that complete list. The it needs to move on to the second PTR record, etc, etc... So only one PTR is being deleted from all list of DNS servers.

This can be done in powershell or *.bat file. I would prefer Powershell.. Then just have it run the "dnscmd" command. We can set a variable for "cachedEntry = Get-Content to make the process work.

C++ Programming DOS Powershell

Project ID: #10099028

About the project

1 proposal Remote project Active 7 years ago