This commit is contained in:
2025-11-21 18:35:31 +08:00
parent 27806421f7
commit 1402473d20
3 changed files with 62 additions and 18 deletions

View File

@@ -2,6 +2,7 @@ package handler
import (
"encoding/base64"
"fmt"
"net"
"os/exec"
"strings"
@@ -90,7 +91,7 @@ func handleDns(c *gin.Context, url string, params map[string]interface{}) {
// 解析dig输出行格式如example.com. 300 IN A 192.168.1.1
parts := strings.Fields(line)
if len(parts) >= 5 {
recordType := parts[3] // IN
// parts[3] 是 "IN" (record type)parts[4] 是记录类型 (A, AAAA, CNAME等)
recordClass := parts[4] // A, AAAA, CNAME等
recordValue := ""
if len(parts) > 5 {