[Pdns-users] Find best zone for given record

William Edwards wedwards at cyberfusion.nl
Thu Feb 2 16:25:03 UTC 2023


Hi,

Is anyone aware of an existing Python/PHP library/function that finds 
the 'best' zone for a given record?

For example, the following PTR records and DNS zones would be matched 
correctly:

- DNS zone '80.10.in-addr.arpa.'
- DNS zone '40.10.in-addr.arpa.'
- PTR record '20.1.80.10.in-addr.arpa.'
- PTR record '12.1.40.10.in-addr.arpa.'

I came across 
https://github.com/PowerDNS/pdns/blob/3ba8b76c8e55fd14397ef73e4fa1e29a92cc9097/pdns/ueberbackend.cc#L320 
(`UeberBackend::getAuth`), which does the same.

It was used for `set-ptr` until its deprecation: 
https://github.com/PowerDNS/pdns/commit/65e921299bf55d5c420e2c7aae1b66c08865cd87#diff-ac1312d4611881e640a571bbe99180d88c382614a910c22ab0b527eddf38d00bL568

However, it seems like `set-ptr` was partly deprecated (?) due to 
`UeberBackend::getAuth` not being fully accurate, according to 
https://github.com/PowerDNS/pdns/issues/4656#issuecomment-445736542

With kind regards,

William Edwards



More information about the Pdns-users mailing list