We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9367cb9 commit b321bc2Copy full SHA for b321bc2
apps/checker/checker/dns.go
@@ -4,6 +4,7 @@ import (
4
"context"
5
"fmt"
6
"net"
7
+ "strings"
8
9
"github.com/rs/zerolog/log"
10
)
@@ -113,6 +114,10 @@ func lookupMX(domain string) ([]string) {
113
114
func lookupNS(domain string) ([]string, error) {
115
116
hosts := []string{}
117
+ isSubdomain := isSubdomain(domain)
118
+ if isSubdomain {
119
+ return hosts, nil
120
+ }
121
nsRecords, err := net.LookupNS(domain)
122
if err != nil {
123
return nil, err
@@ -136,3 +141,12 @@ func lookupTXT(domain string) ([]string) {
136
141
}
137
142
return records
138
143
144
+
145
146
+func isSubdomain(domain string) bool {
147
+ parent := strings.Split(domain, ".")
148
+ if len(parent) < 3 {
149
+ return false
150
151
+ return true
152
+}
0 commit comments