From 1bb5c3b793d6e5a9a6e444cf9a10971ff4f771a0 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 7 Jan 2012 23:10:01 -0500 Subject: just because you have the DNS cache enabled doesn't necessarily mean you want your resolv.conf messed with. Leave that up to the user and what they configure in System>General Setup. Remove a never used and unnecessary function while here. --- config/tinydns/tinydns.inc | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'config/tinydns') diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index bf0cb4b8..ef6513ee 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -235,9 +235,6 @@ function tinydns_custom_php_changeip_command() { if(!empty($config['installedpackages']['tinydns']['config'][0]['enableforwarding'])) { $interfaces = explode(",", $config['installedpackages']['tinydns']['config'][0]['interface']); - exec("/bin/cp {$g['varetc_path']}/resolv.conf {$g['varetc_path']}/resolv.conf.original"); - exec("/bin/cp {$g['varetc_path']}/resolv.conf {$g['varetc_path']}/resolv.conf.dnscache"); - exec("echo domain {$config['system']['domain']} > {$g['varetc_path']}/resolv.conf"); exec("rm -rf {$g['varetc_path']}/dnscache* {$g['varrun_path']}/service/dnscache*"); foreach ($interfaces as $dnsidx => $dnsif) { $dnscacheif = convert_friendly_interface_to_real_interface_name($dnsif); @@ -269,12 +266,9 @@ function tinydns_custom_php_changeip_command() { exec("/bin/mkdir -p {$g['varetc_path']}/dnscache{$dnsidx}/root/ip"); exec("/usr/bin/touch {$g['varetc_path']}/dnscache{$dnsidx}/root/ip/{$dnsuserip}"); tinydns_create_soa_domain_list($dnsserverip, $dnsidx); - exec("echo nameserver {$dnscacheip} >> {$g['varetc_path']}/resolv.conf"); } exec("/usr/bin/killall -9 dnscache"); } else { - if(file_exists("{$g['varetc_path']}/resolv.conf.original")) - exec("/bin/cp {$g['varetc_path']}/resolv.conf.original {$g['varetc_path']}/resolv.conf"); $interfaces = explode(",", $$config['installedpackages']['tinydns']['config'][0]['interface']); foreach ($interfaces as $dnsidx => $dnsif) { if(is_dir("{$g['varetc_path']}/dnscache{$dnsidx}")) @@ -1188,42 +1182,6 @@ function tinydns_create_soa_domain_list($dnsserverip, $index = 0) { } } -/* This function is not called */ -/* At the moment there is no tagging of DNSroute to a WAN port. It needs to be added */ -function tinydns_register_forwarding_servers() { - global $g; - - $fr = fopen("{$g['varetc_path']}/resolv.conf", "r"); - if (! $fr) { - printf("Error: cannot open resolv.conf in tinydns_register_forwarding_servers().\n"); - return 1; - } - $lip = strlen("nameserver") + 1; - $j = 0; - $nsrecords = ""; - $arecords = ""; - while (!feof($fr)) { - $routers = fgets($fr, 4096); - $discard = ($routers[0] == "\n"); - if(!$discard) { - if ($routerip = strstr($routers,"nameserver")) { - $routerip = substr($routerip,$lip); - if($routerip) { - $j += 1; - $routerfqdn = "DNSroute-{$j}.wan{$j}"; - $routerns = "&::{$routerfqdn}"; - $routera = "={$routerfqdn}:{$routerip}"; - $nsrecords .= $routerns . "\n"; - $arecords .= $routera; - } - } - } - } - fclose($fr); - $dnsroutes ="{$nsrecords}{$arecords}"; - return $dnsroutes; -} - function tinydns_register_root_servers() { $rootservers =<< +?> \ No newline at end of file -- cgit v1.2.3