Output to file doesn't support TLDs with multiple periods
NoamResnick opened this issue · 0 comments
NoamResnick commented
The outputToFile function splits the target host on "." and sets the domain to the first result and the tld to the second.
The issue is with target tlds with multiple ".", (eg. com.br, co.il, co.uk, etc.)
the resulting tld loses everything after the first period (eg. com, co, etc).
for _, r := range results {
wg.Add(1)
s := strings.Split(r[0], ".")
domain, tld := s[0], s[1]
go doLookups(r[1], domain, tld, out, *resolve, *geolocate, *whoisflag)
}
the fix should be as simple as changing Split(r[0] ".")
to SplitN(r[0], ".", 2)