Skip to content

Output to file doesn't support TLDs with multiple periods #55

@NoamResnick

Description

@NoamResnick

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions