Skip to content

Commit

Permalink
handler: fix ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Dec 27, 2024
1 parent 64cc591 commit 0f4241d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/handler/default_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ func TestDefault_resolveFromHosts(t *testing.T) {
})

const (
domainV4 = "ipv4.domain.example"
domainV6 = "ipv6.domain.example"
domainV4 = "ipv4.domain.example."
domainV6 = "ipv6.domain.example."
)

var (
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, ptr))
resp.Answer = append(resp.Answer, h.messages.NewPTRAnswer(name, dns.Fqdn(ptr)))
}
default:
h.logger.DebugContext(ctx, "no hosts records found", "name", name, "qtype", q.Qtype)
Expand Down

0 comments on commit 0f4241d

Please sign in to comment.