Fix predefined DNS server

This commit is contained in:
世界 2025-02-21 08:30:34 +08:00
parent 8fc7725e3d
commit 7a090e1219
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
2 changed files with 6 additions and 2 deletions

View File

@ -74,6 +74,7 @@ func (t *PredefinedTransport) Exchange(ctx context.Context, message *mDNS.Msg) (
}() {
copyAnswer := *response.answer
copyAnswer.Id = message.Id
copyAnswer.Question = message.Question
return &copyAnswer, nil
}
}

View File

@ -97,6 +97,9 @@ func (o DNSResponseOptions) Build() ([]dns.Question, *dns.Msg, error) {
MsgHdr: dns.MsgHdr{
Response: true,
Rcode: o.RCode.Build(),
Authoritative: true,
RecursionDesired: true,
RecursionAvailable: true,
},
Answer: common.Map(o.Answer, DNSRecordOptions.build),
Ns: common.Map(o.Ns, DNSRecordOptions.build),