# Classless delegation by RFC2317 - timesaving pratice for customers and providers



## quintessence (Aug 14, 2012)

> *Customer to provider:* Hello, could you please place http://www.example.com as reverse record for this IP address: 5.6.7.8 ? Thanks.
> 
> _(If you are lucky and your provider is "small", which most of the time means the provider would like its customers to be happy, you will get response in the next 24 hours or less, but if it is not ... you may have to wait a couple of days :e )_
> 
> ...



I believe many of you had fallen in similar situation because almost noone uses classless in-addr.arpa delegation, nor ISPs, nor other DCs which offers colocation/dedicated servers/VPS/or similar services.
I believe when you get some small piece of /24 network for your services, it is normal to would like to be able to manage yourself PTR records instead of asking everytime your provider to place for you the nessesary data.

So, let we start delegation by RFC2317 of example small piece of network 10.12.12.0/28 with almost the basic config with no 2nd DNS, with no auto-update, only for testing, which of course does not mean it is not working.

On both sides - customers' one and providers' one I will use 1 nameserver, of course config can be extended regarding your needs.


*1.) Provider side nameserver:*

File named.conf:

The whole /24 network on the provider side where they can be able to cut/split on small pieces regarding customers' needs.


```
zone "12.12.10.in-addr.arpa" {
        type master;
        file "master/12.12.10.in-addr.arpa.zone"; //(for FreeBSD path is [file]/etc/namedb/master[/file] ...)
        allow-query { any; };
};
```

File: 12.12.10.in-addr.arpa:


```
$TTL    86400

@       SOA     [I]priv.provider.net.[/I]        [I]quintessence.provider.net.[/I] // example (
                                    2011081720  ; serial
                                            3H  ; refresh
                                            1H  ; retry
                                            5W  ; expire
                                            4M  ; minimum
                                            )

                        NS              [I]priv.provider.net.[/I] // <-- this is the provider DNS server

0/28                    NS              [I]priv.customer.org.[/I] // <-- this is the customer DNS server

$GENERATE       1-14    $       CNAME     $.0/28.12.12.10.in-addr.arpa.

//(below we can have other records like:

38                      PTR            i-am-the-isp.com.
50                      PTR            my-record.net.

//and so on)
```

File named.conf:

With the code below we define the small piece of /24 network, which the customer will be able to manage itself reverse records.


```
zone "0/28.12.12.10.in-addr.arpa"
{
        type slave;
        file "slave/12.12.10.in-addr.arpa.zone"; //(for FreeBSD path is [file]/etc/namedb/master[/file] ...)
        masters { [I]priv.customer.org[/I]; }; // <-- this is the IP address or hostname of the customer DNS server
        allow-query { any; };
};
```


*2.) Customer side nameserver:*

File named.conf:


```
zone "0/28.12.12.10.in-addr.arpa"
    {
        type master;
        file "master/12.12.10.in-addr.arpa"; //(for FreeBSD path is [file]/etc/namedb/master[/file] ...)
    };
```

File 12.12.10.in-addr.arpa:


```
$TTL    86400

@       SOA     [I]priv.customer.org.[/I]        [I]quintessence.customer.org.[/I] // example (
                                    2011081805  ; serial
                                            3H  ; refresh
                                            1H  ; retry
                                            5W  ; expire
                                            4M  ; minimum
                                            )

                        NS              [I]priv.customer.org.[/I] // <-- this is the customer DNS server
$GENERATE       1-14    $               PTR q-$.test.
```


*3. Let we test*


```
dig @[I]priv.provider.net[/I]  -x 10.12.12.5

; <<>> DiG 9.7.3 <<>> @[I]priv.provider.net[/I] -x 10.12.12.5
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47216
;; flags: qr aa rd; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;5.12.12.10.in-addr.arpa.       IN      PTR

;; ANSWER SECTION:
5.12.12.10.in-addr.arpa. 86400  IN      CNAME   5.0/28.12.12.10.in-addr.arpa.
[B]5.0/28.12.12.10.in-addr.arpa. 86400 IN  PTR     q-5.test.[/B] 

;; AUTHORITY SECTION:
0/28.12.12.10.in-addr.arpa. 86400 IN    NS      [I]priv.customer.org.[/I]

;; ADDITIONAL SECTION:
[I]priv.customer.org.[/I]         300     IN      A       [I]5.6.7.8[/I]

;; Query time: 0 msec
;; SERVER: [I]1.2.3.4[/I]#53([I]1.2.3.4[/I])
;; WHEN: Tue Aug 14 22:46:21 2012
;; MSG SIZE  rcvd: 128
```

It works. :r


----------

