Skip to content

Commit

Permalink
fix: reply only on subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
grishy committed Aug 9, 2023
1 parent 708f82d commit fca815c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/subdomain.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ func reader(ctx context.Context, conn *net.UDPConn) chan *dnsMsg {

// selectQuestion filters and selects questions with the given FQDN suffix.
func selectQuestion(fqdn string, qs []dns.Question) (res []string) {
suffix := "." + fqdn
for _, q := range qs {
if strings.HasSuffix(q.Name, fqdn) {
if strings.HasSuffix(q.Name, suffix) {
res = append(res, q.Name)
}
}
Expand Down

0 comments on commit fca815c

Please sign in to comment.