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

dns.bind_hosts for addresses that aren't permanent #6145

Closed
3 tasks done
nagisa opened this issue Aug 27, 2023 · 2 comments
Closed
3 tasks done

dns.bind_hosts for addresses that aren't permanent #6145

nagisa opened this issue Aug 27, 2023 · 2 comments
Labels
duplicate Duplicate or merged issues.

Comments

@nagisa
Copy link

nagisa commented Aug 27, 2023

Prerequisites

  • I have checked the Wiki and Discussions and found no answer

  • I have searched other issues and found no duplicates

  • I want to request a feature or enhancement and not ask a question

The problem

dns.bind_hosts today requires that there is an interface with each of the addresses at the time adguardhome starts up. This presents a complication when some of the interfaces aren’t static (e.g. WiFi, VPN) or if setting up an interface depends on being able to resolve DNS in the first place (leading to chicken-egg problem.) In particular AdGuardHome today will fail with an error message along the lines of

2023/08/27 12:41:12.796923 [fatal] couldn't start forwwarding DNS server: starting listeners: listening on udp addr 100.64.0.8:53: listening to udp socket: listen udp 100.64.0.8:53: bind: cannot assign requested address

Which then leaves the system without any DNS at all (since it is set up to use 127.0.0.1 as the DNS server…)

Proposed solution

dnsmasq had a functionality that allowed it to start even if the interfaces it was specified to bind to weren’t yet available. It would then monitor interface list at the runtime and bind/unbind sockets as the interfaces would come up or down.

I suggest that adguardhome should be doing the same, rather than crashing if it is unable to bind one of some of the interfaces/addresses.

Alternatives considered and additional information

There is a system-side fix that I’m planning to use for the time being: bind to 0.0.0.0 and then use firewall rules to allow/deny access to adguardhome from specific interfaces.

@sbe-arg

This comment was marked as off-topic.

@ainar-g
Copy link
Contributor

ainar-g commented Jun 18, 2024

Duplicate of #5909

@ainar-g ainar-g marked this as a duplicate of #5909 Jun 18, 2024
@ainar-g ainar-g closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@ainar-g ainar-g added duplicate Duplicate or merged issues. and removed feature request labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Duplicate or merged issues.
Projects
None yet
Development

No branches or pull requests

3 participants