?
Solved

dnscmd

Posted on 2007-10-05
5
Medium Priority
?
215 Views
Last Modified: 2010-04-18
How do I add reverse lookup with the following syntax?
#for /f "tokens=1-3 delims=;" %%a in (input.txt) do (dnscmd SERVERNAME/RecordAdd ZONE_WHERE_ADD_RECORD %%a #%%b %%c >>insert.log)
0
Comment
Question by:alisafia
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20024276
Can you please post in what format entries are inside input.txt file?
0
 
LVL 1

Author Comment

by:alisafia
ID: 20024452
servera A 10.2.2.2
serverb A 10.2.2.3
0
 
LVL 26

Expert Comment

by:Farhan Kazi
ID: 20024499
In for loop you have specified ; semicolon as a delimiter so these entries should be like

servera;A;10.2.2.2
serverb;A;10.2.2.3
0
 
LVL 1

Author Comment

by:alisafia
ID: 20024661
I know, but it works either way, i just want to reverse lookup too.
0
 
LVL 26

Accepted Solution

by:
Farhan Kazi earned 2000 total points
ID: 20024772
I don't think it will work without ; Anyway I tried following statement at my end and it works perfectly.

I applied following statement from command line (not from batch otherwise I will use %%a %%b %%c).

FOR /F "tokens=1-3 delims=;" %a IN (input.txt) DO (DNSCmd.exe SERVER /RecordAdd 0.0.10.in-addr.arpa %a %b %c)

I have following entries inside input.txt file.
PC1;A;10.0.0.15
PC2;A;10.0.0.16
PC3;A;10.0.0.17
PC4;A;10.0.0.18
PC5;A;10.0.0.19
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question