From 12ac163fbf0c76dd8f42dfc1e47c88cbd9be1df4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 18 Feb 2025 17:46:00 +0800 Subject: [PATCH] Fix parsing A records --- option/dns_record.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/option/dns_record.go b/option/dns_record.go index 90c25730..190f5483 100644 --- a/option/dns_record.go +++ b/option/dns_record.go @@ -8,6 +8,7 @@ import ( E "github.com/sagernet/sing/common/exceptions" "github.com/sagernet/sing/common/json" "github.com/sagernet/sing/common/json/badoption" + M "github.com/sagernet/sing/common/metadata" "github.com/miekg/dns" ) @@ -135,6 +136,9 @@ func (o *DNSRecordOptions) UnmarshalJSON(data []byte) error { if err != nil { return err } + if a, isA := record.(*dns.A); isA { + a.A = M.AddrFromIP(a.A).Unmap().AsSlice() + } o.RR = record return nil }