Skip to content

Commit ef2dd46

Browse files
committed
handler: imp code
1 parent 0f4241d commit ef2dd46

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/handler/constructor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (defaultConstructor) NewCompressedResponse(req *dns.Msg, code int) (resp *d
5151
func (defaultConstructor) NewPTRAnswer(fqdn, ptrDomain string) (ans *dns.PTR) {
5252
return &dns.PTR{
5353
Hdr: hdr(fqdn, dns.TypePTR),
54-
Ptr: ptrDomain,
54+
Ptr: dns.Fqdn(ptrDomain),
5555
}
5656
}
5757

internal/handler/hosts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (h *Default) resolveFromHosts(ctx context.Context, req *dns.Msg) (resp *dns
117117
resp = h.messages.NewCompressedResponse(req, dns.RcodeSuccess)
118118
name = req.Question[0].Name
119119
for _, ptr := range ptrs {
120-
resp.Answer = append(resp.Answer, h.messages.NewPTRAnswer(name, dns.Fqdn(ptr)))
120+
resp.Answer = append(resp.Answer, h.messages.NewPTRAnswer(name, ptr))
121121
}
122122
default:
123123
h.logger.DebugContext(ctx, "no hosts records found", "name", name, "qtype", q.Qtype)

0 commit comments

Comments
 (0)