@echo off
for /f %%h in (hostlist) do call :back %%h
ping /n 5 127.1>nul 2>&1
:back
set temp=%1
for /f "skip=1 delims=[] tokens=2" %%i in ('ping /n 1 %1') do call :set %%i
echo %1=%temp%
goto :eof
:set
if "%1"=="" goto :back
set temp=%1
goto :eof
太帅了,程序由ice_log提供
hostlist是一个文本文件,里面一行放一个网址就可以
来一个更快的找域名对应IP的方法(其实就是加了个参数):
@echo off
for /f %%h in (hostlist.txt) do call :back %%h
::ping /n 5 127.1>nul 2>&1
:back
set temp=%1
for /f "skip=1 delims=[] tokens=2" %%i in ('ping /n 1 /i 1 %1') do call :set %%i
echo %1 %temp%
goto :eof
:set
if "%1"=="" goto :back
set temp=%1
goto :eof
引用:
DOS命令快速批量找出网站域名对应的IP地址http://www.yongfa365.com/item/Dos-Comment-Quict-Find-Web-IP.html