dns.bind_hosts: bind to interfaces
Prerequisites
-
[X] I have checked the Wiki and Discussions and found no answer
-
[X] I have searched other issues and found no duplicates
-
[X] I want to request a feature or enhancement and not ask a question
The problem
Sometimes we do not want to bind adguardhome to 0.0.0.0:53.
For example: adguardhome is running on a DHCP-Client machine, and I do want to serve it on eth1:53, but I do not know the DHCP IP of eth1 before it get one.
'dns':
'bind_hosts':
- '127.0.0.1'
- - '192.168.1.2'
+ 'interfaces':
+ - 'eth1'
Proposed solution
Similar with -i, --interface=<interface name> of dnsmasq
-i, --interface=
Listen only on the specified interface(s). Dnsmasq automatically adds the loopback (local) interface to the list of interfaces to use when the --interface option is used. If no --interface or --listen-address options are given dnsmasq listens on all available interfaces except any given in --except-interface options. On Linux, when --bind-interfaces or --bind-dynamic are in effect, IP alias interface labels (eg "eth1:0") are checked, rather than interface names. In the degenerate case when an interface has one address, this amounts to the same thing but when an interface has multiple addresses it allows control over which of those addresses are accepted. The same effect is achievable in default mode by using --listen-address. A simple wildcard, consisting of a trailing '*', can be used in --interface and --except-interface options.
Alternatives considered and additional information
Is this an acceptable feature? I'd love to implement this.
This is an acceptable feature, but we'd rather wait until a few pieces of our network code are refactored to do something like this.
I'm also not entirely sure how something like this can be done on all operating systems that AGH supports.
wait until a few pieces of our network code are refactored
Sure.
can be done on all operating systems
I think network things are hard to say "support all operating systems", even in the current ADH, we also have some *_others.go files.
Implement new features on the top operating systems, give warnings on other operating systems if users force to use these new features, and keep former behaviors if users are not using them.
Out of curiosity, if the IP of the DNS server is dynamic, how do clients find it? Is it doing dynamic DNS and the clients look it up via a different DNS server?
Out of curiosity, if the IP of the DNS server is dynamic, how do clients find it? Is it doing dynamic DNS and the clients look it up via a different DNS server?
For example:
I'm using a cute 1-Port machine as a travel router(without wifi), running ADH, wireguard, and other services. I know the interface name, but I do not know the IP. If using dns.bind_hosts, I have to modify the config file in every hotel.