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

Unable to query for root servers #18

Open
nzbart opened this issue Oct 6, 2016 · 3 comments
Open

Unable to query for root servers #18

nzbart opened this issue Oct 6, 2016 · 3 comments

Comments

@nzbart
Copy link

nzbart commented Oct 6, 2016

I am unable to make requests for the root servers. This is what I do in nslookup (on Windows):

> nslookup - 8.8.8.8
Default Server:  google-public-dns-a.google.com
Address:  8.8.8.8

> set type=ns
> .
Server:  google-public-dns-a.google.com
Address:  8.8.8.8

Non-authoritative answer:
(root)  nameserver = c.root-servers.net
(root)  nameserver = g.root-servers.net
(root)  nameserver = d.root-servers.net
(root)  nameserver = b.root-servers.net
(root)  nameserver = a.root-servers.net
(root)  nameserver = f.root-servers.net
(root)  nameserver = l.root-servers.net
(root)  nameserver = j.root-servers.net
(root)  nameserver = m.root-servers.net
(root)  nameserver = e.root-servers.net
(root)  nameserver = i.root-servers.net
(root)  nameserver = k.root-servers.net
(root)  nameserver = h.root-servers.net

However, when I do the following using this library, an incorrect request is sent (when inspected via Wireshark):

var client = new DnsClient("8.8.8.8");
var rootServers = client.Resolve(".", RecordType.NS);

Is there a way to query for the root records? Essentially, what I want to achieve is the equivalent of:

dig +trace example.com
@kapetan
Copy link
Owner

kapetan commented Sep 9, 2020

I don't think that's a valid DNS query. Hope you figured it out.

@kapetan kapetan closed this as completed Sep 9, 2020
@nzbart
Copy link
Author

nzbart commented Sep 9, 2020

I no longer need this because I found a workaround, but - for future reference - dig can make these requests, so the DNS system definitely supports it. The . is not literally sent to the DNS server, of course, but it appears that an empty request is sent. Here's a screenshot from a Wireshark capture where dig requests the root name servers:

image
To reproduce, simply capture DNS traffic in Wireshark and run dig +trace example.com.

@kapetan
Copy link
Owner

kapetan commented Sep 9, 2020

Now I see the issue. Maybe the domain name parsing needs to be changed. A workaround at the moment is to use an empty label array, e.g:

DnsClient client = new DnsClient("8.8.8.8");
IResponse response = await client.Resolve(new Domain(new byte[0][]), RecordType.NS); // or new string[]

@kapetan kapetan reopened this Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants