[Pdns-users] problem with zone cache

mail at dr4g0n.name mail at dr4g0n.name
Mon Feb 27 17:47:22 UTC 2023


Hi,

i have a problem with zone cache, read the note 
https://www.ncartron.org/testing-powerdns-450-beta1s-zone-cache.html , 
my enviroment:
  OS Ubuntu 20.04
  pdns-server 4.6.2 with pdns-backend-mysql

pdns config:
  # pdns_control current-config diff
  # Autogenerated configuration file based on running instance 
(2023-02-27 20:34:59 +0300)
  disable-syslog=
  domain-metadata-cache-ttl=60
  gmysql-dbname=pdns_master_new
  gmysql-host=localhost
  gmysql-password=PASSWORD
  gmysql-user=pdns_dev
  launch=gmysql
  local-address=127.0.0.1
  log-timestamp=no
  loglevel=7
  query-logging=yes
  server-id=pdns-dev-2
  write-pid=no

create empty zone test.com:
  # pdnsutil list-zone test.com
  $ORIGIN .
  test.com        3600    IN      SOA     
a.misconfigured.dns.server.invalid hostmaster.test.com 0 10800 3600 
604800 3600

When running PowerDNS in logs in MySQL, such a request:
  Execute  select domains.id, domains.name, records.content, 
domains.type, domains.master, domains.notified_serial, 
domains.last_check, domains.account from domains LEFT JOIN records ON 
records.domain_id=domains.id AND records.type='SOA' AND 
records.name=domains.name WHERE records.disabled=0 OR 1

requesting a non-existent subdomain:
  # dig 1.test.com A @localhost +short

in logs PowerDNS:
  pdns_server[383254]: Query 140271215988672: SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name=? and domain_id=?
  pdns_server[383254]: Query 140271215988672: 1418 usec to execute
  pdns_server[383254]: Query 140271215988672: 1794 total usec to last row
  pdns_server[383254]: Query 140271215988672: SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name=? and domain_id=?
  pdns_server[383254]: Query 140271215988672: 261 usec to execute
  pdns_server[383254]: Query 140271215988672: 276 total usec to last row
  pdns_server[383254]: Query 140271216022352: select kind,content from 
domains, domainmetadata where domainmetadata.domain_id=domains.id and 
name=?
  pdns_server[383254]: Query 140271216022352: 416 usec to execute
  pdns_server[383254]: Query 140271216022352: 430 total usec to last row
  pdns_server[383254]: Query 140271215988672: SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name=? and domain_id=?
  pdns_server[383254]: Query 140271215988672: 328 usec to execute
  pdns_server[383254]: Query 140271215988672: 343 total usec to last row


in logs MySQL:
  341667 Prepare  SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name=? and domain_id=?
  341667 Execute  SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name='test.com' and domain_id=2
  341667 Reset stmt
  341667 Execute  SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name='1.test.com' and domain_id=2
  341667 Reset stmt
  341667 Prepare  select kind,content from domains, domainmetadata where 
domainmetadata.domain_id=domains.id and name=?
  341667 Execute  select kind,content from domains, domainmetadata where 
domainmetadata.domain_id=domains.id and name='test.com'
  341667 Reset stmt
  341667 Execute  SELECT 
content,ttl,prio,type,domain_id,disabled,name,auth FROM records WHERE 
disabled=0 and name='*.test.com' and domain_id=2
  341667 Reset stmt

why is there a request to MySQL if the subdomain does not exist?


More information about the Pdns-users mailing list