Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set RecursionAvailable in static responses #404

Merged
merged 1 commit into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions blocklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (r *Blocklist) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {

answer := new(dns.Msg)
answer.SetReply(q)
answer.RecursionAvailable = q.RecursionDesired

// We have an IP address to return, make sure it's of the right type. If not return NXDOMAIN.
var spoof []dns.RR
Expand Down
1 change: 1 addition & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func responseWithCode(q *dns.Msg, rcode int) *dns.Msg {
func ptr(q *dns.Msg, names []string) *dns.Msg {
a := new(dns.Msg)
a.SetReply(q)
a.RecursionAvailable = q.RecursionDesired
answer := make([]dns.RR, 0, len(names))
for _, name := range names {
rr := &dns.PTR{
Expand Down
1 change: 1 addition & 0 deletions static-template.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func NewStaticTemplateResolver(id string, opt StaticResolverOptions) (*StaticTem
func (r *StaticTemplateResolver) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {
answer := new(dns.Msg)
answer.SetReply(q)
answer.RecursionAvailable = q.RecursionDesired
log := logger(r.id, q, ci)

answer.Answer = r.processRRTemplates(q, ci, r.answer...)
Expand Down
1 change: 1 addition & 0 deletions static.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func NewStaticResolver(id string, opt StaticResolverOptions) (*StaticResolver, e
func (r *StaticResolver) Resolve(q *dns.Msg, ci ClientInfo) (*dns.Msg, error) {
answer := new(dns.Msg)
answer.SetReply(q)
answer.RecursionAvailable = q.RecursionDesired
log := logger(r.id, q, ci)

// Update the name of every answer record to match that of the query
Expand Down
Loading