# reddig **Repository Path**: 0ldm0s/reddig ## Basic Information - **Project Name**: reddig - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-16 - **Last Updated**: 2026-08-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # reddig 🛰️ > **Red Alert DNS Intelligence Gathering** > A modern DNS lookup tool inspired by Red Alert - dig reimagined with better UX ## 🎯 特性 - 🚀 **高性能**: 基于 `rat_quickdns` 库,支持 UDP/TCP/DoH/DoT 四种协议 - 🎨 **友好界面**: 彩色输出、表格格式,比传统 dig 更易读 - 🎮 **红警彩蛋**: 启动提示、错误信息都充满红警风格 - 📊 **性能测试**: 内置多服务器性能对比功能 - 🔒 **DNSSEC支持**: 完整的 DNSSEC 验证和状态显示 - 📋 **多种输出**: 表格、JSON、简洁、dig兼容等多种格式 - ⚡ **智能优化**: 自动选择最优DNS服务器和协议 ## 🚀 快速开始 ### 基本查询 ```bash # 查询A记录(默认) reddig google.com # 查询IPv6地址 reddig google.com --type AAAA # 查询MX记录 reddig google.com --type MX # 查询所有常用记录 reddig google.com --all ``` ### 指定DNS服务器 ```bash # 使用Google DNS reddig google.com --server 8.8.8.8 # 使用Cloudflare DNS reddig google.com --server 1.1.1.1 ``` ### 协议选择 ```bash # 使用TCP协议 reddig google.com --protocol tcp # 使用DNS over HTTPS reddig google.com --protocol doh # 使用DNS over TLS reddig google.com --protocol dot ``` ### 性能测试 ```bash # 测试多个DNS服务器性能 reddig google.com --benchmark # 显示详细统计信息 reddig google.com --stats ``` ### DNSSEC验证 ```bash # 启用DNSSEC验证 reddig cloudflare.com --dnssec # 详细DNSSEC信息 reddig cloudflare.com --dnssec --verbose ``` ## 📋 命令行选项 ### 基本选项 - `DOMAIN` - 要查询的域名 - `-t, --type ` - DNS记录类型 (A, AAAA, CNAME, MX, TXT, NS, PTR, SRV, SOA) - `-s, --server ` - DNS服务器地址 - `-p, --protocol ` - 传输协议 (udp, tcp, doh, dot, auto) ### 查询选项 - `-a, --all` - 查询所有常用记录类型 - `-b, --benchmark` - 性能测试模式 - `-x, --reverse` - 反向DNS查询 - `--timeout ` - 查询超时时间(默认5秒) - `--retry ` - 重试次数(默认2次) ### DNSSEC选项 - `--dnssec` - 启用DNSSEC验证 - `--client-subnet ` - 客户端子网(EDNS) - `--no-cache` - 禁用缓存 ### 输出选项 - `-f, --format ` - 输出格式 (table, json, short, dig, verbose) - `-q, --quiet` - 静默模式(不显示彩蛋) - `-v, --verbose` - 详细模式 - `--stats` - 显示查询统计信息 ### 网络选项 - `--tcp` - 使用TCP协议(等同于 --protocol tcp) - `-4, --ipv4` - 仅使用IPv4 - `-6, --ipv6` - 仅使用IPv6 - `--trace` - 追踪DNS查询路径 ## 🎨 输出格式示例 ### 默认表格格式 ``` 🛰️ Reinforcement: Satellite Uplink Established! ═══════════════════════════════════════════════ 📡 Standard Radar: UDP Transmission Active 🎯 DNS Query Results for google.com ═══════════════════════════════════════════════════════════ 📋 A Records: ┌──────┬─────────────────┬─────┬─────────┐ │ Type │ Value │ TTL │ Details │ ├──────┼─────────────────┼─────┼─────────┤ │ A │ 142.250.191.14 │ 5m │ (IPv4) │ └──────┴─────────────────┴─────┴─────────┘ ✅ Mission Accomplished! ``` ### JSON格式 ```bash reddig google.com --format json ``` ```json { "domain": "google.com", "record_type": "A", "protocol": "UDP", "server_used": "8.8.8.8", "total_time_ms": 45, "responses": [ { "success": true, "records": [ { "name": "google.com", "type": "A", "value": "142.250.191.14", "ttl": 300 } ], "duration_ms": 45 } ] } ``` ### 性能测试输出 ``` 🔥 Initiating Multi-Vector DNS Strike! ⚔️ Testing All Available Uplinks... 🔄 Switching to Uplink: Google DNS ✅ Google DNS responded in 23ms 🔄 Switching to Uplink: Cloudflare DNS ✅ Cloudflare DNS responded in 18ms 🔄 Switching to Uplink: 阿里DNS ✅ 阿里DNS responded in 31ms 🏆 Fastest Server: Cloudflare DNS (18ms) 📊 Battle Report: 🎯 Queries Executed: 6 ⏱️ Total Mission Time: 156ms ⚡ Performance Rating: Lightning Fast! ``` ## 🔧 高级用法 ### 批量查询不同记录类型 ```bash # 查询域名的所有信息 reddig example.com --all --verbose ``` ### 使用DoH进行安全查询 ```bash # 使用Cloudflare DoH reddig example.com --protocol doh --server https://cloudflare-dns.com/dns-query # 使用阿里DoH reddig example.com --protocol doh --server https://dns.alidns.com/dns-query ``` ### EDNS客户端子网 ```bash # 指定客户端IP获得CDN优化结果 reddig cdn.example.com --client-subnet 1.2.3.4 ``` ### 反向DNS查询 ```bash # 查询IP的域名 reddig 8.8.8.8 --reverse ``` ## 🎮 红警彩蛋 reddig 充满了红警风格的彩蛋: - **启动彩蛋**: "🛰️ Reinforcement: Satellite Uplink Established!" - **错误彩蛋**: "💥 Unit Lost!" 或 "📡 Signal Interrupted!" - **成功彩蛋**: "✅ Mission Accomplished!" - **协议切换**: "📡 Standard Radar: UDP Transmission Active" - **性能测试**: "🔥 Initiating Multi-Vector DNS Strike!" - **DNSSEC**: "🔒 Security Protocols: DNSSEC Verification Passed!" 使用 `--quiet` 参数可以禁用所有彩蛋。 ## 🆚 与 dig 的对比 | 功能 | dig | reddig | |------|-----|--------| | 基本查询 | `dig google.com` | `reddig google.com` | | 指定服务器 | `dig @8.8.8.8 google.com` | `reddig google.com --server 8.8.8.8` | | 查询类型 | `dig google.com MX` | `reddig google.com --type MX` | | TCP协议 | `dig +tcp google.com` | `reddig google.com --tcp` | | 简洁输出 | `dig +short google.com` | `reddig google.com --format short` | | JSON输出 | ❌ | `reddig google.com --format json` | | 性能测试 | ❌ | `reddig google.com --benchmark` | | 彩色输出 | ❌ | ✅ 默认支持 | | DoH/DoT | 复杂配置 | `--protocol doh/dot` | ## 🙏 致谢 - [rat_quickdns](../rat_quickdns) - 强大的DNS解析库 - [clap](https://github.com/clap-rs/clap) - 命令行解析 - [colored](https://github.com/mackwic/colored) - 彩色输出 - [tabled](https://github.com/zhiburt/tabled) - 表格格式化 - 《红色警戒》- 创意灵感来源 --- **"Commander, the network is under your control!"** 🎮 [English Documentation](README.md) | [日本語ドキュメント](README.jp.md)