├── .gitignore ├── README.md ├── debug.bat ├── dig-32bit ├── check-ip6.bat ├── check.bat ├── dig.exe ├── libbind9.dll ├── libdns.dll ├── libeay32.dll ├── libirs.dll ├── libisc.dll ├── libisccc.dll ├── libisccfg.dll ├── liblwres.dll ├── libxml2.dll └── readme.md ├── dig-64bit ├── check-ip6.bat ├── check.bat ├── dig.exe ├── libbind9.dll ├── libdns.dll ├── libeay32.dll ├── libirs.dll ├── libisc.dll ├── libisccc.dll ├── libisccfg.dll ├── liblwres.dll ├── libxml2.dll └── readme.md └── tool └── wget.exe /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | ip* 3 | url* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **特别声明:[checkiptools](https://github.com/xyuanmu/checkiptools) 已经集成dig功能并且支持多线程,建议用该工具进行解析!** 2 | 3 | ## 软件说明 4 | * 一个简单的使用dig扩展功能获取谷歌IP的工具 5 | * 支持平台:Windows 6 | * 支持网站:[Best DNS](http://www.bestdns.org/), [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 7 | * 下载地址:[点击下载](https://github.com/xyuanmu/dig/archive/master.zip) 8 | 9 | ## debug工具使用方法: 10 | 1. 方法一: 11 | 1. 到 [Best DNS](http://www.bestdns.org/) 首页 **Where do you need a DNS from?** 下方选一个地区的网址进行复制。 12 | 2. 或者到 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 选择 **Öffentliche Nameserver nach Ländern** 下方的地区网址进行复制。 13 | 3. 运行 debug.bat,右键,粘贴网址,按下回车,之后会自动获取网页内的IP并使用dig工具获取返回的IP段。 14 | 2. 方法二: 15 | 1. 在 debug.bat 所在目录新建一个 ip.txt,将自己收集IP地址复制进去,一行一个。 16 | 2. 运行 debug.bat 自动使用dig工具获取返回的IP段。 17 | 3. 方法三: 18 | 1. 在 debug.bat 所在目录新建一个 url.txt,复制 [Best DNS](http://www.bestdns.org/) 站点的网址进去,一行一个。 19 | 2. 或者新建一个 url2.txt,复制 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 站点的网址进去,一行一个。 20 | 3. 运行 debug.bat 自动下载所有网页并使用dig工具获取返回的IP段。 21 | 4. 生成 ip_range.txt 后将里面的IP段导入扫描工具如 [checkiptools](https://github.com/xyuanmu/checkiptools) 进行扫描和管理。 22 | 23 | ## 注意事项: 24 | * 目前支持的地址只有 [Best DNS](http://www.bestdns.org/) 和 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) ,而且 [Best DNS](http://www.bestdns.org/) 首页格式不同无法获取。 25 | * url.txt 和 url2.txt 两个文件不要弄混,url.txt 输入 [Best DNS](http://www.bestdns.org/) 网址,url2.txt 输入 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 网址。 26 | * 为方便以后查看,日志文件 dig.log 默认重命名,有洁癖的可以手动删除。 27 | * 为保证下次启动后不会重新下载 url 文件里的网址,下载成功后会重命名 url 文件,若无用可手动删除。 28 | * 每次结束时会自行整理 ip_range.txt 去掉之前出现过的IP段,若只想获取本次结果可手动删除后再运行 debug.bat。 29 | * **软件需要完整VC++ 2005运行库**,若提示“应用程序无法启动...使用命令行 sxstrace.exe 工具”,请到[这里下载安装](https://www.microsoft.com/zh-CN/download/details.aspx?id=26347)。 30 | 31 | ## dig工具使用方法: 32 | 1. 根据系统选择32位(dig-32bit)或64位(dig-64bit)。 33 | 1. 双击运行 check.bat,如果是IPv6用户运行 check-ip6.bat。 34 | 2. 到DNS网站找各个地区DNS,输入模拟的IP,按下回车键。 35 | 3. 获取 ANSWER SECTION 下方的IP,如果不是谷歌官方IP段,则是GGC,丢进 [checkiptools](https://github.com/xyuanmu/checkiptools) 或 GoGo Tester 里扫描。 36 | 37 | ## 谷歌官方IP段: 38 | ``` 39 | nslookup -q=TXT _netblocks.google.com 8.8.8.8 40 | 64.18.0.0/20 41 | 64.233.160.0/19 42 | 66.102.0.0/20 43 | 66.249.80.0/20 44 | 72.14.192.0/18 45 | 74.125.0.0/16 46 | 173.194.0.0/16 47 | 207.126.144.0/20 48 | 209.85.128.0/17 49 | 216.58.192.0/19 50 | 216.239.32.0/19 51 | ``` 52 | 53 | ## 方法原理: 54 | 利用dig中EDNS扩展中的subnet功能(为了解析到距离更近的主机,这里可以模拟DNS查询的来源IP),查Google的四个权威DNS: 55 | ``` 56 | ns1.google.com (216.239.32.10) 57 | ns2.google.com (216.239.34.10) 58 | ns3.google.com (216.239.36.10) 59 | ns4.google.com (216.239.38.10) 60 | ``` 61 | 62 | ## 使用dig查询: 63 | 在cmd里输入: 64 | * 如果你要IPv4地址(大多数人用IPv4): 65 | ``` dig +subnet=X.X.X.X @ns1.google.com www.google.com``` 66 | * 如果你要IPv6地址: 67 | ```dig +subnet=2001:db8:1234::1234 @ns1.google.com aaaa www.google.com``` 68 | ``` 69 | X.X.X.X和那个2001:db8开头的地址改成你想模拟的来源IP 70 | 最后的www.google.com可以改成其他的Google域名 71 | ns1.google.com可以换成ns2,ns3,ns4,或者干脆用IP地址 72 | 来源IP优先选择亚洲的IP,延时小,速度快 73 | 因为Google的官方IP被封的差不多了,所以要找Google Global Cache IP (GGC IP) 74 | ``` 75 | -------------------------------------------------------------------------------- /debug.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal EnableDelayedExpansion 3 | if exist "%windir%\sysWOW64\" (set sys=64bit) else set sys=32bit 4 | ::echo.Your system is %sys% 5 | 6 | if exist "%~dp0url.txt" ( 7 | del html.txt >nul 2>nul 8 | for /f "delims=" %%i in (url.txt) do ( 9 | "%~dp0tool/wget.exe" %%i -O html-0.txt 10 | for /f "delims=" %%i in (html-0.txt) do echo.%%i>> html.txt 11 | del html-0.txt>nul 2>nul 12 | ) 13 | goto :getip 14 | ) 15 | 16 | if exist "%~dp0url2.txt" ( 17 | del html.txt >nul 2>nul 18 | for /f "delims=" %%i in (url2.txt) do ( 19 | "%~dp0tool/wget.exe" %%i -O html-0.txt 20 | for /f "delims=" %%i in (html-0.txt) do echo.%%i>> html.txt 21 | del html-0.txt>nul 2>nul 22 | ) 23 | goto :getip2 24 | ) 25 | 26 | if exist "%~dp0ip.txt" ( 27 | cls 28 | echo. 29 | echo.There is exist ip.txt, would you like to dig IP from ip.txt or get a new one? 30 | echo. 31 | echo.1. dig IP from ip.txt 2. Get a new ip.txt 32 | echo. 33 | choice /c 12 /n /m "Please make a choice: " 34 | if errorlevel 2 ( 35 | goto :getip 36 | ) 37 | if errorlevel 1 ( 38 | goto :dig 39 | ) 40 | ) 41 | goto :getip 42 | 43 | :dig 44 | if exist "%~dp0dig.log" (set num=0 & for /f %%a in ('dir/b dig.*log') do set/a num+=1) 45 | rename dig.log dig.%num%.log >nul 2>nul 46 | echo. 47 | echo Get ip.txt, begin dig IP. 48 | for /f "delims=" %%i in (ip.txt) do ( 49 | set /a n+=1 50 | echo dig !n! ip: %%i 51 | "%~dp0/dig-%sys%/dig" +subnet=%%i @ns1.google.com www.google.com>> dig.log 2>> nul 52 | ) 53 | echo dig finished^^! 54 | goto :ExtractIP 55 | 56 | :getip 57 | if exist "%~dp0url.txt" (set num=0 & for /f %%a in ('dir/b url.*txt') do set/a num+=1) 58 | rename url.txt url.%num%.txt >nul 2>nul 59 | if exist "%~dp0html.txt" ( 60 | findstr "

Nameserver Details:

" html.txt > ip-0.txt 61 | ) else ( 62 | if defined url ( 63 | "%~dp0tool/wget.exe" %url% -O html.txt 64 | findstr "

Nameserver Details:

" html.txt > ip-0.txt 65 | ) else goto :seturl 66 | ) 67 | 68 | del ip.txt>nul 2>nul 69 | for /f "tokens=2" %%i in (ip-0.txt) do echo %%i>> ip.txt 70 | del ip-0.txt html.txt>nul 2>nul 71 | if exist "%~dp0ip.txt" (goto :dig) else echo Something went wrong^^! & goto :exit 72 | 73 | :getip2 74 | if exist "%~dp0url2.txt" (set num=0 & for /f %%a in ('dir/b url2.*txt') do set/a num+=1) 75 | rename url2.txt url2.%num%.txt >nul 2>nul 76 | if exist "%~dp0html.txt" ( 77 | findstr "https://apps.db.ripe.net/search/query.html?searchtext=" html.txt >> ip-0.txt 78 | ) else ( 79 | if defined url ( 80 | "%~dp0tool/wget.exe" %url% -O html.txt 81 | findstr "https://apps.db.ripe.net/search/query.html?searchtext=" html.txt >> ip-0.txt 82 | ) else goto :seturl 83 | ) 84 | 85 | del ip.txt>nul 2>nul 86 | for /f "tokens=3 delims==" %%i in (ip-0.txt) do ( 87 | for /f tokens^=1^ delims^=^" %%i in ("%%i") do echo %%i>> ip.txt 88 | ) 89 | del ip-0.txt html.txt>nul 2>nul 90 | if exist "%~dp0ip.txt" (goto :dig) else echo Something went wrong^^! & goto :exit 91 | 92 | :ExtractIP 93 | echo. 94 | echo Extract IP from dig.log, please wait a second... 95 | del ip_range-0.txt >nul 2>nul 96 | for /f "tokens=5" %%a in ('findstr /b "www\.google\.com\." dig.log') do ( 97 | for /f "tokens=1-3 delims=." %%b in ("%%a") do ( 98 | echo %%b.%%c.%%d.0/24>> ip_range-0.txt 99 | ) 100 | ) 101 | if exist "%~dp0ip_range.txt" ( 102 | for /f %%i in (ip_range.txt) do ( 103 | echo %%i>> ip_range-0.txt 104 | ) 105 | ) 106 | del ip_range.txt >nul 2>nul 107 | for /f "delims=" %%i in (ip_range-0.txt) do ( 108 | if not defined %%i set %%i=A & echo %%i>>ip_range.txt 109 | ) 110 | del ip_range-0.txt >nul 2>nul 111 | goto :exit 112 | 113 | :seturl 114 | cls 115 | set /p url="please input a url: " 116 | echo %url%|findstr "bestdns" >nul 117 | if %errorlevel% equ 0 ( 118 | goto :getip 119 | ) else goto :getip2 120 | 121 | 122 | :exit 123 | pause 124 | exit -------------------------------------------------------------------------------- /dig-32bit/check-ip6.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | :check 5 | echo. 6 | set /p i= input ip: 7 | dig +subnet=%i% @ns1.google.com aaaa www.google.com 8 | call :check 9 | -------------------------------------------------------------------------------- /dig-32bit/check.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | :check 5 | echo. 6 | set /p i= input ip: 7 | dig +subnet=%i% @ns1.google.com www.google.com 8 | call :check 9 | -------------------------------------------------------------------------------- /dig-32bit/dig.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/dig.exe -------------------------------------------------------------------------------- /dig-32bit/libbind9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libbind9.dll -------------------------------------------------------------------------------- /dig-32bit/libdns.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libdns.dll -------------------------------------------------------------------------------- /dig-32bit/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libeay32.dll -------------------------------------------------------------------------------- /dig-32bit/libirs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libirs.dll -------------------------------------------------------------------------------- /dig-32bit/libisc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libisc.dll -------------------------------------------------------------------------------- /dig-32bit/libisccc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libisccc.dll -------------------------------------------------------------------------------- /dig-32bit/libisccfg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libisccfg.dll -------------------------------------------------------------------------------- /dig-32bit/liblwres.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/liblwres.dll -------------------------------------------------------------------------------- /dig-32bit/libxml2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-32bit/libxml2.dll -------------------------------------------------------------------------------- /dig-32bit/readme.md: -------------------------------------------------------------------------------- 1 | ## 使用方法: 2 | 1. 双击运行 check.bat,如果是IPv6用户运行 check-ip6.bat。 3 | 2. 到 [Best DNS](http://www.bestdns.org/) 或者 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 找各个地区DNS,输入模拟的IP,按下回车键。 4 | 3. 获取 ANSWER SECTION 下方的IP,如果不是谷歌官方IP段,则是GGC,丢进 checkgoogleip 或 GoGo Tester 里扫描。 5 | 6 | ## 谷歌官方IP段: 7 | ``` 8 | nslookup -q=TXT _netblocks.google.com 8.8.8.8 9 | 64.18.0.0/20 10 | 64.233.160.0/19 11 | 66.102.0.0/20 12 | 66.249.80.0/20 13 | 72.14.192.0/18 14 | 74.125.0.0/16 15 | 173.194.0.0/16 16 | 207.126.144.0/20 17 | 209.85.128.0/17 18 | 216.58.192.0/19 19 | 216.239.32.0/19 20 | ``` 21 | 22 | 23 | ## 方法原理: 24 | 利用dig中EDNS扩展中的subnet功能(为了解析到距离更近的主机,这里可以模拟DNS查询的来源IP),查Google的四个权威DNS: 25 | ``` 26 | ns1.google.com (216.239.32.10) 27 | ns2.google.com (216.239.34.10) 28 | ns3.google.com (216.239.36.10) 29 | ns4.google.com (216.239.38.10) 30 | ``` 31 | 32 | 33 | ## 使用dig查询: 34 | 在cmd里输入: 35 | * 如果你要IPv4地址(大多数人用IPv4): 36 | ``` dig +subnet=X.X.X.X @ns1.google.com www.google.com``` 37 | * 如果你要IPv6地址: 38 | ```dig +subnet=2001:db8:1234::1234 @ns1.google.com aaaa www.google.com``` 39 | ``` 40 | X.X.X.X和那个2001:db8开头的地址改成你想模拟的来源IP 41 | 最后的www.google.com可以改成其他的Google域名 42 | ns1.google.com可以换成ns2,ns3,ns4,或者干脆用IP地址 43 | 来源IP优先选择亚洲的IP,延时小,速度快 44 | 因为Google的官方IP被封的差不多了,所以要找Google Global Cache IP (GGC IP) 45 | ``` 46 | -------------------------------------------------------------------------------- /dig-64bit/check-ip6.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | :check 5 | echo. 6 | set /p i= input ip: 7 | dig +subnet=%i% @ns1.google.com aaaa www.google.com 8 | call :check 9 | -------------------------------------------------------------------------------- /dig-64bit/check.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd %~dp0 3 | 4 | :check 5 | echo. 6 | set /p i= input ip: 7 | dig +subnet=%i% @ns1.google.com www.google.com 8 | call :check 9 | -------------------------------------------------------------------------------- /dig-64bit/dig.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/dig.exe -------------------------------------------------------------------------------- /dig-64bit/libbind9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libbind9.dll -------------------------------------------------------------------------------- /dig-64bit/libdns.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libdns.dll -------------------------------------------------------------------------------- /dig-64bit/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libeay32.dll -------------------------------------------------------------------------------- /dig-64bit/libirs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libirs.dll -------------------------------------------------------------------------------- /dig-64bit/libisc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libisc.dll -------------------------------------------------------------------------------- /dig-64bit/libisccc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libisccc.dll -------------------------------------------------------------------------------- /dig-64bit/libisccfg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libisccfg.dll -------------------------------------------------------------------------------- /dig-64bit/liblwres.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/liblwres.dll -------------------------------------------------------------------------------- /dig-64bit/libxml2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/dig-64bit/libxml2.dll -------------------------------------------------------------------------------- /dig-64bit/readme.md: -------------------------------------------------------------------------------- 1 | ## 使用方法: 2 | 1. 双击运行 check.bat,如果是IPv6用户运行 check-ip6.bat。 3 | 2. 到 [Best DNS](http://www.bestdns.org/) 或者 [Ungefiltert surfen](http://www.ungefiltert-surfen.de/) 找各个地区DNS,输入模拟的IP,按下回车键。 4 | 3. 获取 ANSWER SECTION 下方的IP,如果不是谷歌官方IP段,则是GGC,丢进 checkgoogleip 或 GoGo Tester 里扫描。 5 | 6 | ## 谷歌官方IP段: 7 | ``` 8 | nslookup -q=TXT _netblocks.google.com 8.8.8.8 9 | 64.18.0.0/20 10 | 64.233.160.0/19 11 | 66.102.0.0/20 12 | 66.249.80.0/20 13 | 72.14.192.0/18 14 | 74.125.0.0/16 15 | 173.194.0.0/16 16 | 207.126.144.0/20 17 | 209.85.128.0/17 18 | 216.58.192.0/19 19 | 216.239.32.0/19 20 | ``` 21 | 22 | 23 | ## 方法原理: 24 | 利用dig中EDNS扩展中的subnet功能(为了解析到距离更近的主机,这里可以模拟DNS查询的来源IP),查Google的四个权威DNS: 25 | ``` 26 | ns1.google.com (216.239.32.10) 27 | ns2.google.com (216.239.34.10) 28 | ns3.google.com (216.239.36.10) 29 | ns4.google.com (216.239.38.10) 30 | ``` 31 | 32 | 33 | ## 使用dig查询: 34 | 在cmd里输入: 35 | * 如果你要IPv4地址(大多数人用IPv4): 36 | ``` dig +subnet=X.X.X.X @ns1.google.com www.google.com``` 37 | * 如果你要IPv6地址: 38 | ```dig +subnet=2001:db8:1234::1234 @ns1.google.com aaaa www.google.com``` 39 | ``` 40 | X.X.X.X和那个2001:db8开头的地址改成你想模拟的来源IP 41 | 最后的www.google.com可以改成其他的Google域名 42 | ns1.google.com可以换成ns2,ns3,ns4,或者干脆用IP地址 43 | 来源IP优先选择亚洲的IP,延时小,速度快 44 | 因为Google的官方IP被封的差不多了,所以要找Google Global Cache IP (GGC IP) 45 | ``` 46 | -------------------------------------------------------------------------------- /tool/wget.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyuanmu/dig/dbc2bf36d6b9a57d89b499a4911d15502adcba5c/tool/wget.exe --------------------------------------------------------------------------------