dnscmd

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)
LVL 1
alisafiaAsked:
Who is Participating?
 
Farhan KaziConnect With a Mentor Systems EngineerCommented:
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
 
Farhan KaziSystems EngineerCommented:
Can you please post in what format entries are inside input.txt file?
0
 
alisafiaAuthor Commented:
servera A 10.2.2.2
serverb A 10.2.2.3
0
 
Farhan KaziSystems EngineerCommented:
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
 
alisafiaAuthor Commented:
I know, but it works either way, i just want to reverse lookup too.
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.