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] The --local-addr option is invalid ? #481

Open
Baoxd123 opened this issue Nov 26, 2024 · 1 comment
Open

[Bug] The --local-addr option is invalid ? #481

Baoxd123 opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@Baoxd123
Copy link

Describe the bug

Even if I added the local addr option following the help instruction, the local address did not change.

To Reproduce

echo "censys.io" | ./zdns A --local-addr 128.192.12.101 //the ip can be anything, because all are invalid

Expected behavior
The src IP should be "128.192.12.101" but no change in the captured packets.

Screenshots
Indeed, the local IP "128.192.12.188" does not exist in my machine, but I can specify it and nothing changed in the captured packets.
image

@Baoxd123 Baoxd123 added the bug label Nov 26, 2024
@zakird zakird added this to the Version 2.0 milestone Dec 10, 2024
@phillip-stephens
Copy link
Contributor

Hey @Baoxd123! Thanks for filing this issue.

You're correct, in this case we're ignoring your specified --local-addr. If you use --verbosity=5, you'll see some logs explaining why:

INFO[0000] using local addresses: [128.192.12.101]
INFO[0000] for non-iterative lookups, using external nameservers: 127.0.0.53:53
INFO[0000] for iterative lookups, using nameservers: 127.0.0.53:53
INFO[0000] no name server provided for external lookup, using  random external name server: 127.0.0.53:53
...
INFO[0000] none of the user-supplied local addresses could connect to name server 127.0.0.53:53, using local address 127.0.0.1

By default if you don't specify any external nameservers with --name-servers, we use whatever DNS resolver is configured in /etc/resolver.conf. It looks like for you that's "resolver":"127.0.0.53". That's a loopback DNS resolver on your host machine. We wouldn't be able to connect to it using your specified 128.192.12.188 so instead of failing and leaving it to the user to try to figure out why, we switch to using a public-facing IP address for your host.

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

3 participants