Mise en place des zones catalog
===============================

.. attention::

    Ici je vais utiliser une valeur fictive.
    Le nom de la zone catalog sera example.catalog.

Donc tu vas créer une zone de type catalog.

D'abord, tu vas créer un fichier qui contient la zone.

.. code-block::
    :caption: /tmp/producer.zone

    $TTL 3600
    $ORIGIN example.catalog.
    @               IN      SOA     invalid. hostmaster.invalid. (
                            1     ; serial
                            1H    ; refresh
                            10M   ; retry
                            1W    ; expire
                            1800  ; negTTL
                            )

    @               IN      NS      invalid.

.. code-block:: bash

    pdnsutil zone load example.catalog /tmp/producer.zone
    pdnsutil zone set-kind example.catalog producer
    pdnsutil catalog set as51144.net example.catalog

Pour vérifier si ça fonctionne correctement, tu peux lancer :

.. code-block:: bash

    dig @127.0.0.1 AXFR example.catalog

Le résultat donne ceci :

.. code-block::

    ; <<>> DiG 9.18.33 <<>> @127.0.0.1 AXFR example.catalog
    ; (1 server found)
    ;; global options: +cmd
    example.catalog.	3600	IN	SOA	invalid. hostmaster.invalid. 1789832269 3600 600 604800 1800
    example.catalog.	3600	IN	NS	invalid.
    version.example.catalog. 0	IN	TXT	"2"
    vkc3qdum3kkgdtb901ul8f80m0okmcam.zones.example.catalog.	0 IN PTR as51144.net.
    example.catalog.	3600	IN	SOA	invalid. hostmaster.invalid. 1789832269 3600 600 604800 1800
    ;; Query time: 5 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1) (TCP)
    ;; WHEN: Sat Sep 19 15:41:31 UTC 2026
    ;; XFR size: 5 records (messages 3, bytes 347)

.. attention::

    Vu qu'aucun NS n'est défini, il faut ajouter une métadonnée also-notify sur les secondaires.

    Cette opération peut déjà se faire depuis PowerAdmin.
