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

[Bug] Using ZDNS with --all-nameservers --iterative produces empty output #482

Closed
steurer opened this issue Dec 3, 2024 · 1 comment
Closed
Assignees
Labels

Comments

@steurer
Copy link

steurer commented Dec 3, 2024

Running echo example.com. | ./zdns A --all-nameservers --iterative produces this output:

{"altered_name":"example.com","name":"example.com.","results":{"A":{"data":{"results":[]},"duration":0.005172124,"status":"NOERROR","timestamp":"2024-12-03T14:33:32Z"}}}
00h:00m:00s; Scan Complete; 1 names scanned; 185.79 names/sec; 100.0% success rate; NOERROR: 1

Expected Output:

Either the full iterative lookup trace (with all-nameservers) or an error stating error stating that using both (--all-nameservers and --iterative at the same time) is not supported.

Potential Cause:

BasicLookupModule.Lookup does not support both flags in parallel

func (lm *BasicLookupModule) Lookup(resolver *zdns.Resolver, lookupName string, nameServer *zdns.NameServer) (interface{}, zdns.Trace, zdns.Status, error) {
	if lm.LookupAllNameServers {
		return resolver.LookupAllNameservers(&zdns.Question{Name: lookupName, Type: lm.DNSType, Class: lm.DNSClass}, nameServer)
	}
	if lm.IsIterative {
		return resolver.IterativeLookup(&zdns.Question{Name: lookupName, Type: lm.DNSType, Class: lm.DNSClass})
	}
	return resolver.ExternalLookup(&zdns.Question{Type: lm.DNSType, Class: lm.DNSClass, Name: lookupName}, nameServer)
}

The reason why the output with the --iterative flag is empty, seems to be that randomExternalNameServer already returns a root-server IP if --iterative is set.

@phillip-stephens
Copy link
Contributor

With #485, this is now resolved!

$ echo example.com. | ./zdns A --all-nameservers --iterative
00h:00m:01s; 0 names scanned; 0.00 names/sec; NaN% success rate;
{"altered_name":"example.com","name":"example.com.","results":{"A":{"data":{"per_layer_responses":{".":[{"nameserver":"j.root-servers.net","result":{"additionals":[{"answer":"192.5.6.30","class":"IN","name":"a.gtld-servers.net","ttl":172800,"type":"A"},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants