September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -5,34 +5,34 @@
|
|||
|
||||
set "domain=www.kame.net"
|
||||
echo DOMAIN: "%domain%"
|
||||
echo.
|
||||
echo(
|
||||
call :DNS_Lookup "%domain%"
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
|
||||
::Main Procedure
|
||||
::Uses NSLOOKUP Command and a Temporary File
|
||||
::Also uses a dirty "parsing" to detect IP addresses.
|
||||
|
||||
::Uses NSLOOKUP Command. Also uses a dirty "parsing" to detect IP addresses.
|
||||
:DNS_Lookup [domain]
|
||||
setlocal enabledelayedexpansion
|
||||
for /f "delims=" %%T in ('forfiles /p "%~dp0." /m "%~nx0" /c "cmd /c echo(0x09"') do set "TAB=%%T"
|
||||
set "temp_file=%TMP%\NSLOOKUP_%RANDOM%.TMP"
|
||||
|
||||
::Define Variables and the TAB Character
|
||||
set "dom=%~1"
|
||||
set "record="
|
||||
for /f "tokens=1* delims=:" %%x in ('nslookup "%~1" 2^>nul') do (
|
||||
set "line=%%x"
|
||||
if "!line:~0,4!"=="Name" set "record=yes"
|
||||
if "!line:~0,5!"=="Alias" set "record="
|
||||
if "!record!"=="yes" (
|
||||
if "%%y"=="" (echo %%x>>"%temp_file%") else (echo %%x:%%y>>"%temp_file%")
|
||||
)
|
||||
set "reccnt=0"
|
||||
for /f "delims=" %%T in ('forfiles /p "%~dp0." /m "%~nx0" /c "cmd /c echo(0x09"') do set "TAB=%%T"
|
||||
|
||||
setlocal enabledelayedexpansion
|
||||
for /f "tokens=1* delims=:" %%x in ('nslookup "!dom!" 2^>nul') do (
|
||||
set "line=%%x"
|
||||
if /i "!line:~0,4!"=="Name" set "record=yes"
|
||||
if /i "!line:~0,5!"=="Alias" set "record="
|
||||
if "!record!"=="yes" (
|
||||
set /a reccnt+=1
|
||||
if "%%y"=="" (set "catch_!reccnt!=%%x") else (set "catch_!reccnt!=%%x:%%y")
|
||||
)
|
||||
)
|
||||
if exist "%temp_file%" (
|
||||
for /f "tokens=*" %%a in (
|
||||
'findstr /BC:"Address" "%temp_file%" ^& findstr /BC:"%TAB%" "%temp_file%"'
|
||||
) do (set "data=%%a"&echo !data:*s: =!)
|
||||
del /q "%temp_file%"
|
||||
) else (echo Connection to domain failed.)
|
||||
for /l %%c in (1,1,%reccnt%) do (
|
||||
if /i "!catch_%%c:~0,7!"=="Address" echo(!catch_%%c:*s: =!
|
||||
if /i "!catch_%%c:~0,1!"=="%TAB%" echo(!catch_%%c:%TAB% =!
|
||||
)
|
||||
endlocal
|
||||
goto :EOF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue