[ldns-users] Programmatically creating a zone

Ray Bellis Ray.Bellis at nominet.org.uk
Thu Sep 2 19:01:07 UTC 2010


On 2 Sep 2010, at 19:14, Bryan Duff wrote:

> As opposed to read it from a file, or from a packet.  The API doesn't
> seem to be the best in this scenario.
> 
> Is there something I'm missing?

An LDNS zone structure (ldns_zone) is nothing more than an ldns_rr* for the SOA, and an ldns_rr_list* for the records therein, and there are functions to access and modify those - see <http://www.nlnetlabs.nl/projects/ldns/doc/zone_8c_source.html>

e.g.

  ldns_zone *z = ldns_zone_new();
  ldns_zone_set_soa(z, soa);     // requires an SOA "ldns_rr*" object
  ldns_zone_push_rr(z, rr);      // requires other "ldns_rr*" object

Is the real issue figuring how to create an "ldns_rr"?

Ray







More information about the ldns-users mailing list