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

Recursive resolution doesn't work if 2+ labels down delegation (example: domain.com delegating subdomain.label2.label1.domain.com directly). #148

Open
kakwa opened this issue Oct 16, 2024 · 0 comments

Comments

@kakwa
Copy link

kakwa commented Oct 16, 2024

dnsr seems to have issues resolving records if there is a 2+ labels down delegation in the mix.

As a test example, I've delegated subdeleg.notdel.notdel.notdel.notdel.kakwalab.ovh. (note the notdel intermediary labels) from kakwalab.ovh. and created an A test record record.subdeleg.notdel.notdel.notdel.notdel.kakwalab.ovh. with value 1.1.1.1.

package main

import (
    "fmt"
    "os"
    "github.com/domainr/dnsr"
)

func main() {
    // Create a new DNS resolver
    resolver := dnsr.NewResolver()

    // The IP to reverse lookup (PTR query)
    rec := "record.subdeleg.notdel.notdel.notdel.notdel.kakwalab.ovh."
    dnsr.MaxNameservers = 1
    dnsr.MaxIPs = 1
    dnsr.DebugLogger = os.Stdout

    // Query A record (nil)
    results := resolver.Resolve(rec, "A")
    fmt.Printf("%#v\n", results)

    // Query again (has response (thanks to cache?))
    // results = resolver.Resolve(rec, "A")
    // fmt.Printf("%#v\n", results)
}

Using the above code returns a nil object while dig record.subdeleg.notdel.notdel.notdel.notdel.kakwalab.ovh. A properly returns 1.1.1.1.

This seems to come from the fact dnsr only query for NS one label down.

This issue is common for PTR resolution.

Note:

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

1 participant