pdns icon indicating copy to clipboard operation
pdns copied to clipboard

BIND backend reports unknown type 'secondary' but doesn't report unknown keyword 'primaries'

Open jpmens opened this issue 3 years ago • 1 comments

  • Program: Authoritative
  • Issue type: Bug report

Short description

PowerDNS Authoritative with the BIND backend correctly reports a zone type secondary as unknown, but it doesn't complain about missing primary servers when the secondary (slave) zone is configured with primaries instead of masters.

$ cat named.conf
zone "a1.dnslab.org" IN {
	type secondary;
	primaries { 192.0.2.1; };
	file "/etc/pdns/a1";
};

Environment

  • Operating system: CentOS Linux 8
  • Software version: 4.7.0-alpha0.192.master.g3f4b183ea
  • Software source: repo.powerdns.com

Steps to reproduce

  1. Configure pdns.conf
    bind-config=/etc/pdns/named.conf
    daemon=no
    disable-axfr=no
    disable-syslog=yes
    guardian=no
    launch=bind
    log-dns-details=yes
    master=no
    secondary=yes
    setgid=pdns
    setuid=pdns
    slave=yes
    
  2. Configure named.conf
    zone "a1.dnslab.org" IN {
    	type secondary;
    	primaries { 192.0.2.1; };
    	file "/etc/pdns/a1";
    };
    
  3. Launch PowerDNS
    # pdns_server
    Jan 13 12:53:40 [bindbackend] Parsing 1 domain(s), will report when done
    Jan 13 12:53:40 [bindbackend] Warning! Skipping zone 'a1.dnslab.org' because type 'secondary' is invalid
    Jan 13 12:53:40 [bindbackend] Done parsing domains, 1 rejected, 0 new, 0 removed
    
  4. Replace secondary by slave in named.conf
  5. Launch
    # pdns_server
    Jan 13 13:05:26 [bindbackend] Parsing 1 domain(s), will report when done
    Jan 13 13:05:26 [bindbackend] error at 2022-01-13 13:05:26 +0000 no file found for new slave domain 'a1.dnslab.org'. Has not been AXFR'd yet
    Jan 13 13:05:26 [bindbackend] Done parsing domains, 1 rejected, 1 new, 0 removed
    
  6. Replace primaries by masters in named.conf
  7. Launch
    # pdns_server
    Jan 13 13:06:13 [bindbackend] Parsing 1 domain(s), will report when done
    Jan 13 13:06:13 [bindbackend] error at 2022-01-13 13:06:13 +0000 no file found for new slave domain 'a1.dnslab.org'. Has not been AXFR'd yet
    Jan 13 13:06:13 [bindbackend] Done parsing domains, 1 rejected, 1 new, 0 removed
    ...
    Jan 13 13:06:13 Zone 'a1.dnslab.org' (/etc/pdns/a1) reloaded
    Jan 13 13:06:13 AXFR-in zone: 'a1.dnslab.org', primary: '137.184.55.191', zone committed with serial 3
    

Expected behaviour

I expected PowerDNS to report that the word primaries is unknown or that there are no primaries/masters configured for the secondary zone.

Actual behaviour

No diagnostic message, and no transfer of the secondary zone.

jpmens avatar Jan 13 '22 13:01 jpmens

I believe we ignore unknown commands inside zone { } and we simply do not recognise primaries yet.

Habbie avatar Jan 13 '22 13:01 Habbie