Koozali.org: home of the SME Server

BUG: SME6.x dnscache-conf action script is faulty

simnux

BUG: SME6.x dnscache-conf action script is faulty
« on: May 04, 2004, 03:04:05 PM »
1. Inconsistent reference to delegate_domains_2localDNS()

The sub declaration refers to delegate_domains_2localDNS(), but the code uses delegate_domains_2DNS(). I propose the former is more informative and should be used throughout.

2. Handling of the dnscache::Forwarder property is incorrect.

When a forwarder is defined, the code traps for this and calls delegate_domains_2localDNS() without any parameters. This results in dnscache being configured to force ONLY localhost lookups to be resolved via localhost (tinydns). This means that local names such as "ftp" and "mail" and "www" cannot be resolved properly.

The offending code looks like this:

Code: [Select]

if ($dnscache->prop('Forwarder'))
{
    # We handle no domains locally
    delegate_domains_2DNS();
}
else
{
    delegate_domains_2DNS(
        %reversenets,
       map { $_->key => $_->prop('NameServer') || '127.0.0.1' }
                ( $domains->get_all_by_prop('type', 'domain'),
                  $domains->get_all_by_prop('type', 'domain-remote')
                )
        );
}


I believe the correct coding for this should simply eliminate the if{} block and use the code in the else:

Code: [Select]

# handle locally defined domains/networks locally
delegate_domains_2DNS(
    %reversenets,
            map { $_->key => $_->prop('NameServer') || '127.0.0.1' }
            ( $domains->get_all_by_prop('type', 'domain'),
              $domains->get_all_by_prop('type', 'domain-remote')
            )
    );


Without this change if a forwarder is defined it seems impossible for the system to resolve any local names as dnscache will never attempt to query tinydns.

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
BUG: SME6.x dnscache-conf action script is faulty
« Reply #1 on: May 06, 2004, 03:21:57 AM »
Did you open a bug report for this?  Just curious.
......

gmr2000

BUG: SME6.x dnscache-conf action script is faulty
« Reply #2 on: August 27, 2004, 07:06:57 AM »
Thanks a lot. :hammer:

I have spent more than a week trying to solve this issue and finally it is work.