ldns tutorial

Miek Gieben

In this tutorial we will explain how to make a simple application with ldns. Also some insights in the setup/construction of ldns is given.


Table of Contents
1. Introduction ldns
1.1. 213.154.224.1
1.2. A
1.3. IN
1.4. 3600
1.5. open.nlnetlabs.nl
2. Making a small application with ldns

1. Introduction ldns

The following paragraphs will introduce some concepts used in ldns. It is assumed that the reader is familiar with DNS (knowledge of DNSSEC is not a problem).

Take for instance the following RR:


open.nlnetlabs.nl       8600    IN      A       213.154.224.1
This RR consists out of five elements:
open.nlnetlabs.nl

the ownername of the RR

8600

the TTL of the RR

IN

the class of the RR

A

the type of the RR

213.154.224.1

1 rdata field, in this case with the address

1.1. 213.154.224.1

To begin with the last element, ldns calls that a RDATA FIELD, or rdf. This is the smallest type in ldns. An RR's rdata consists of 1 or several rdf's. All these rdf's have a type, in the case of an A record, this type is LDNS_RDF_TYPE_A. The data in a rdf is stored in network byte order.

1.2. A

This is the type of the whole RR, this type is called LDNS_RR_TYPE_A in ldns

1.3. IN

The class. Other possible values are CH, and HS. But only the IN class is used on the Internet.

1.4. 3600

The TTL of a RR, stored in host order.

1.5. open.nlnetlabs.nl

The ownername of the RR, this owner name is stored in wire data, this this particaliar name is stored as 04open09nlnetlabs02nl00.