Skip to content

Commit

Permalink
handler: imp code
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 27, 2024
1 parent 0f4241d commit ef2dd46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/handler/constructor.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (defaultConstructor) NewCompressedResponse(req *dns.Msg, code int) (resp *d
func (defaultConstructor) NewPTRAnswer(fqdn, ptrDomain string) (ans *dns.PTR) {
return &dns.PTR{
Hdr: hdr(fqdn, dns.TypePTR),
Ptr: ptrDomain,
Ptr: dns.Fqdn(ptrDomain),
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/handler/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (h *Default) resolveFromHosts(ctx context.Context, req *dns.Msg) (resp *dns
resp = h.messages.NewCompressedResponse(req, dns.RcodeSuccess)
name = req.Question[0].Name
for _, ptr := range ptrs {
resp.Answer = append(resp.Answer, h.messages.NewPTRAnswer(name, dns.Fqdn(ptr)))
resp.Answer = append(resp.Answer, h.messages.NewPTRAnswer(name, ptr))
}
default:
h.logger.DebugContext(ctx, "no hosts records found", "name", name, "qtype", q.Qtype)
Expand Down

0 comments on commit ef2dd46

Please sign in to comment.