2
I have the need to run a local DNS server for a local (non-routable) domain on my laptop, for development purposes. Simply editing /etc/hosts
is not sufficient for my case, because I need certain VMs, which depend on actual DNS, to resolve the local domain.
Configuring bind to serve the local domain is easy. Configuring bind with forwarding addresses is also easy.
The problem lies in that once bind is configured, and resolvconf set to use 127.0.0.1 for name resolution, connections to wireless networks that depend on a web-based authentication breaks, since the local wireless network's DNS servers are no longer used.
Is there some way to dynamically set Bind's forwarding addresses when the network is brought up (perhaps via resolvconf, or some other similar service)?
Alternately, is there some way to use my local bind server only for my local domain name, and use those provided by DHCP for all other name resolution?
Do you have
resolvconf-update-bind
script in/etc/resolvconf/update.d/
directory? – AnFi – 2017-09-20T05:16:18.543Why don't you drop bind in favour of DNSMasq? – davidgo – 2017-09-20T05:53:47.297
@davidgo: dnsmasq doesn't work as an authoritative name server, so obviously it won't serve my needs. Maybe dnsmasq could be used along side bind, to accomplish my needs--if you think it would, I'd love to see your answer. – Flimzy – 2017-09-20T14:26:14.593
@AndrzejA.Filip: No, I'm not familiar with that file. Is that part of the standard resolvconf distribution? – Flimzy – 2017-09-20T14:27:05.337
@Flimzy AFAIR: Sample script (for bind8) is provided in debian
resolvconf
package BUT it is not installed in/etc/resolvconf/update.d/
. – AnFi – 2017-09-20T18:17:40.267@AndrzejA.Filip: Thanks, that was the hint I needed. If you'd like to turn that into an answer, I'll accept it. – Flimzy – 2017-09-20T21:41:27.673
As your local DNS is "non-routable", DNSMasq should be up to the task - you simply put the IP addresses in the hosts file and let DNSMasq inject these into the local recursive DNS served by DNSMasq, or specify them with "address=" lines, or even palm off zones to another BIND dns server using the "server" directive. DNSMasq will inject the domains in hosts files by default (unless no-hosts" is turned on). – davidgo – 2017-09-21T07:42:38.063
Another possibility - unless I'm missing something- which is probable - would be to turn your BIND instance into a full-blown recursive DNS server, ie to not use forwarders. This will (slightly) slow down your DNS response times though, because it can't take advantage of the larger nameservers cache. – davidgo – 2017-09-21T07:44:49.473
@davidgo That wouldn't help with these wireless access points that redirect to a login page before allowing full network access. – Flimzy – 2017-09-21T11:17:09.357