Bug #439
closedTinyDNS: dnscache fails if LAN has no address assigned
0%
Description
BETA snapshot 20100321-0116
If you create a bridge for several LAN interfaces, you assign the bridge an address, but leave the LAN interface unassigned.
In TinyDNS, if you then enable DNS forwarding from LAN, DNS resolving does not work at all.
The problem seems to be in the function "tinydns_custom_php_changeip_command" in the file "tinydns.inc".
First the function sets
$ip = $config['interfaces']['lan']['ipaddr']; [...] $dnscacheip = $ip;
It then goes through great pains to get a $dnsserverip
However, after setting up tinydns:
exec("/usr/local/bin/dnscache-conf Gdnscache Gdnslog /etc/dnscache {$dnscacheip}");
But at this time, $dnscacheip is null.
In addition to the above, the "/etc/resolv.conf" written is invalid.
Proposal:
Have a radio-group or checkbox-group showing interfaces with (static) assigned addresses, and allow dnscache to be bound on one/any of those.
Updated by Henrik Kaare Poulsen over 15 years ago
Dear all,
I would not mind digging into the pfSense code and propose a patch.
However, being a complete newbee to pfSense, I have some questions:
Currently the TinyDNS settings are like this:
Binding IP Address IP Address [__________] DNS-Cache server [check] Enable DNS Forwarders [check] Register DHCP static mappings with server [check] Register DHCP leases with server
I would propose to change this into
DNS-Cache server [check] Enable DNS Forwarders Bind to interface [check] First interface with static IP ... [check] n'th interface with static IP [check] Register DHCP static mappings with server [check] Register DHCP leases with server DNS Server [check] Enable DNS Server Bind to interface [radio] First interface with static IP ... [radio] n'th interface with static IP [radio] 127.0.0.1
Questions:
Is this the right way of doing it?
If this is the right way of doing it:
The above TinyDNS is served with pkg_edit.php?xml=tinydns.xml (not a specific .php). Is it possible to dynamically generate the interface lists with pkg_edit.php?
If not, should we create a specific tinydns_settings.php for this?
Updated by Henrik Kaare Poulsen over 15 years ago
The GUI looks OK now, but it still does not work.
The problem seems to be in tinydns.inc function tinydns_custom_php_changeip_command where we have
exec("echo {$dnscacheip} > /etc/dnscache{$dnsidx}/env/IP");
But the env subdirectory does not exist.
I believe the above should be prefixed with
if (!is_dir("/etc/dnscache{$dnsidx}/env"))
exec("mkdir -p /etc/dnscache{$dnsidx}/env");
Updated by Henrik Kaare Poulsen over 15 years ago
I can confirm that this is now solved - thank you!
Updated by Chris Buechler over 15 years ago
- Status changed from Feedback to Resolved