Re: [OpenWrt-Devel] netifd + split dns servers
On Thu, Jan 8, 2015 at 5:43 PM, Nikos Mavrogiannopoulos n.mavrogiannopou...@gmail.com wrote: Currently a protocol can register a dns server with netifd using the proto_add_dns_server function. That however, does not allow registering a DNS server for a specific domain. I checked the netifd code and there is no provision for that. Would it make sense to add such functionality to netifd, or should I make openconnect directly register its split-dns servers with dnsmasq? regards, Nikos Netifd writes the dns servers in /tmp/resolv.conf.auto which are read by dnsmasq. However I don't see a way to pass DNS servers for a specific domain via the resolv.conf.auto file to dnsmasq unless changes are done in dnsmasq. If such functionality needs to be supported; the changes will not only be limited to netifd. And netifd rewriting dnsmasq.conf seems a bit hacky too me Br, Hans ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd + split dns servers
On Fri, Jan 9, 2015 at 9:48 AM, Hans Dedecker dedec...@gmail.com wrote: On Thu, Jan 8, 2015 at 5:43 PM, Nikos Mavrogiannopoulos n.mavrogiannopou...@gmail.com wrote: Currently a protocol can register a dns server with netifd using the proto_add_dns_server function. That however, does not allow registering a DNS server for a specific domain. I checked the netifd code and there is no provision for that. Would it make sense to add such functionality to netifd, or should I make openconnect directly register its split-dns servers with dnsmasq? Netifd writes the dns servers in /tmp/resolv.conf.auto which are read by dnsmasq. However I don't see a way to pass DNS servers for a specific domain via the resolv.conf.auto file to dnsmasq unless changes are done in dnsmasq. If such functionality needs to be supported; the changes will not only be limited to netifd. And netifd rewriting dnsmasq.conf seems a bit hacky too me The resolv.conf format is very limited, if you rely on it you can only register global dns servers, and that's all. With dnsmasq, to support split-dns you need to configure a config directory for dnsmasq, and then place files in it that contain with the following format: server=/domain/address.ip regards, Nikos ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd + split dns servers
On Fri, Jan 9, 2015 at 12:25 PM, Steven Barth cy...@openwrt.org wrote: Our dnsmasq init script registers /tmp/dnsmasq.d as an additional configuration dir, so you can place files there and restart it. However I'm not sure as to how much we want netifd to do dnsmasq-specific stuff or how we would do it. Well I think that depends on how common use case is to have a dns server per domain. Currently I think I can handle that in openconnect directly, but if any other vpn application would like to do that, they'll have to duplicate that code. Of course the bad thing here again is that dnsmasq doesn't support soft-reloading and every time you restart it you lose your dns cache etc. etc. Interestingly it supports the 'servers-file' option which would allow re-loading the domain specific servers without a restart. But even in that case the cache will be cleared. regards, Nikos ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd + split dns servers
Our dnsmasq init script registers /tmp/dnsmasq.d as an additional configuration dir, so you can place files there and restart it. However I'm not sure as to how much we want netifd to do dnsmasq-specific stuff or how we would do it. Of course the bad thing here again is that dnsmasq doesn't support soft-reloading and every time you restart it you lose your dns cache etc. etc. Cheers, Steven ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel