Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -0,0 +1,38 @@
:: DNS Query Task from Rosetta Code Wiki
:: Batch File Implementation
@echo off
set "domain=www.kame.net"
echo DOMAIN: "%domain%"
echo(
call :DNS_Lookup "%domain%"
pause
exit /b
::Main Procedure
::Uses NSLOOKUP Command. Also uses a dirty "parsing" to detect IP addresses.
:DNS_Lookup [domain]
::Define Variables and the TAB Character
set "dom=%~1"
set "record="
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")
)
)
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

View file

@ -0,0 +1,11 @@
@echo off
setlocal enableextensions enabledelayedexpansion
set catch=
for /f "skip=4 tokens=*" %%g in ('nslookup www.kame.net 2^>nul') do (
set "a=%%g"
if defined catch echo %%g
if "!a:~0,7!" equ "Address" (
for /f "tokens=2" %%h in ('echo %%g') do echo %%h
set catch=1
)
)

View file

@ -0,0 +1,14 @@
@echo off
setlocal enableextensions enabledelayedexpansion
call :getdns -4
call :getdns -6
goto :eof
:getdns
for /f "tokens=*" %%g in ('ping %1 -n 1 www.kame.net') do (
set a=%%g
if "!a:~0,15!" equ "Ping statistics" (
echo !a:~20,-1!
goto :eof
)
)
goto :eof