Skip to content

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

@kakwa

Description

@kakwa

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions