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

Example usage of --dns option does not work as described #6

Open
Luflosi opened this issue Feb 12, 2024 · 0 comments
Open

Example usage of --dns option does not work as described #6

Luflosi opened this issue Feb 12, 2024 · 0 comments

Comments

@Luflosi
Copy link

Luflosi commented Feb 12, 2024

dnslink --help prints (among others) these examples:

# Receive the dnslink entries for the dnslink.io domain.
> dnslink dnslink.dev
/ipfs/QmXNosdfz3WQUHncsYBTw7diwYzCibVhrJmEhNNaMPQBQF

and

# Receive the dnslink entries using the system DNS.
> dnslink --dns dnslink.dev
/ipfs/QmXNosdfz3WQUHncsYBTw7diwYzCibVhrJmEhNNaMPQBQF

This leads me to believe that dnslink does not use the system resolver by default (which I don't like) but specifying --dns does use the system resolver.
But executing the example dnslink --dns dnslink.dev just panics:

panic: invalid argument to Intn

goroutine 1 [running]:
math/rand.(*Rand).Intn(0x18?, 0x666a40?)
	math/rand/rand.go:180 +0x4c
math/rand.Intn(0xc000020258?)
	math/rand/rand.go:453 +0x25
main.main.NewUDPLookup.func1({0xc000020258, 0x14})
	github.com/dnslink-std/go/dnslink.go:244 +0x16c
github.com/dnslink-std/go.resolve(0xc0000e1ab0?, {0x7ffeff05e63f?, 0xb?})
	github.com/dnslink-std/go/dnslink.go:313 +0x156
github.com/dnslink-std/go.(*Resolver).Resolve(...)
	github.com/dnslink-std/go/dnslink.go:86
main.main()
	github.com/dnslink-std/go/dnslink/main.go:298 +0x9fa

Maybe not specifying the --dns option is what actually uses the system resolver and the documentation is just wrong?

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