named-checkzone as library?
dot at dotat.at
Wed Jun 30 21:41:53 UTC 2021
Felipe Gasper <felipe at felipegasper.com> wrote:
> Is there any public code interface that exposes named-checkzone’s functionality?
> I’d specifically like to have numeric error codes rather than strings.
It isn't easy to do that, I'm afraid.
There are two places that don't do what you want. The source for
named-checkzone is in
The file named-checkzone.c has the setup and option handling, and
check-tool.c has some of the zone checks - but not all. It deals with
things like using the system resolver to check CNAME or MX records that
point out of the zone.
There are also a load of checks in lib/dns/zone.c - look for
integrity_checks() and the various zone_check_*() functions.
Both lib/dns/zone.c and bin/check/check-tool.c report their findings by
logging; there isn't an intermediate error code that might describe the
problem. And BIND's error codes are simple errno-style numbers: they can't
say multi-parameter things like "foo.dotat.at/MX points to bar.dotat.at
which is a CNAME".
f.anthony.n.finch <dot at dotat.at> https://dotat.at/
North Utsire, South Utsire: Variable 2 to 4. Slight or moderate. Fog
patches later. Moderate or good, occasionally very poor later.
More information about the bind-users