Hey Experts! I'm not sure if this can be done but if it can, I know this is the group that will figure it out.
In the following script, I use the computer name as the %computer% variable and then ping it. The %computer% variable is logged to a file as is the IP. The problem that I ran into is that (in rare occasions) the IP actually resolves to a different hostname. So, I was curious how I could get the script to ping the %computer% and based on the IP given, run a ping -a %ip% next so that I can see what the DNS record is. Again, not sure if it is possible but I figured I would ask as it would help our trouble-shooting here.
echo ----[Computer Info]----> %logfile%
echo %Computer% >> %logfile%
ping -n 2 %computer%>> %logfile%
echo. >> %logfile%
Thanks in advance experts.
**UPDATED** Could nslookup be used?