nurweilesgeht
Goto Top

BIND .jnl disable integration to original Zonefile

Hallo zusammen,

ich bin momentan etwas mit dhcpd in Kombination mit Bind9 für ddns am Rumtesten und mich stört die Integration der temporären Datei bzw. die Umänderung meines Zonefiles. Sobald ich den Dienst bind/named neustarte, integriert bind die Einträge in mein Zonefile für die Zone und ändert auch andere Einträge. Kann ich das irgendwie abschalten, ohne das ich Berechtigungen an der Datei ändern muss? Wenn ja wie?

Mein Zonefile für meine statischen und dynamischen Einträge ist folgendes, nachdem bind dies durch den Mixer steckte:
$ORIGIN .
$TTL 86400      ; 1 day
test.example.local   IN SOA  test.example.local. root.test.example.local. (
                                2020011852 ; serial
                                10800      ; refresh (3 hours)
                                900        ; retry (15 minutes)
                                604800     ; expire (1 week)
                                86400      ; minimum (1 day)
                                )
                        NS      dhcp01.test.example.local.
$ORIGIN test.example.local.
gateway2.1              A       172.16.2.1
$TTL 3600       ; 1 hour
pc1                A       172.16.6.246
                        TXT     "3139614c642e9d050b6bbc083d4844d694"  
$TTL 86400      ; 1 day
server1            A       10.0.1.24
dhcp01                  A       172.16.2.20
$TTL 3600       ; 1 hour
testcache               A       172.16.2.16
                        TXT     "31b13ac193016324ea64afcf2d867b57d1"  
$TTL 86400      ; 1 day
onlyoffice01            A       10.0.1.84
wiki                    A       172.16.2.13

zone "test.example.local" {  
        type master;
        file "/etc/named/zones/test.example.local";  
        allow-update { key "rndc-key"; };  
};

Und aus dem DHCP (selbe Maschine)
key "rndc-key" {  
        algorithm hmac-md5;
        secret "asdasdasd";  
};

zone test.example.local. {
        primary 127.0.0.1;
        key rndc-key;
}
ddns-domainname "test.example.local.";  

ddns-update-style interim;
ignore client-updates;
update-static-leases on;
use-host-decl-names on;
#include /etc/rndc.key;
update-optimization off;
update-conflict-detection on;

Eigendliche Frage: Was muss ich abändern, damit die temporären Einträge nicht in meine Datei verschobne werden?

Viele Grüße & einen schönen Feiertag
nurweilesgeht

Content-Key: 667022

Url: https://administrator.de/contentid/667022

Printed on: April 19, 2024 at 04:04 o'clock

Member: lcer00
lcer00 May 24, 2021 at 09:56:53 (UTC)
Goto Top
Hallo,

Zitat von @NurWeilEsGeht:

Eigendliche Frage: Was muss ich abändern, damit die temporären Einträge nicht in meine Datei verschobne werden?

Das ist so nicht vorgesehen. Das journalfile wird immer irgendwann in das Zonefile integriert. https://ftp.isc.org/isc/bind9/cur/9.16/doc/arm/html/advanced.html#the-jo ...

Du könntest lediglich das per skript eine Sicherungsdatei des originalen Zonefiles erstellen und diese z.b. beim Systemstart oder per cronjob "resetten". dabei muss aber der bind-daemon jeweils gestoppt werden.

Grüße

lcer
Mitglied: 148121
148121 May 24, 2021 updated at 11:58:05 (UTC)
Goto Top
Moin,
lies mal diesen Abschnitt über das Konzept von dynamischen Zonen
https://bind9.readthedocs.io/en/latest/advanced.html

The zone files of dynamic zones cannot normally be edited by hand because they are not guaranteed to contain the most recent dynamic changes; those are only in the journal file. The only way to ensure that the zone file of a dynamic zone is up-to-date is to run rndc stop.

To make changes to a dynamic zone manually, follow these steps: first, disable dynamic updates to the zone using rndc freeze zone. This updates the zone file with the changes stored in its .jnl file. Then, edit the zone file. Finally, run rndc thaw zone to reload the changed zone and re-enable dynamic updates.

rndc sync zone updates the zone file with changes from the journal file without stopping dynamic updates; this may be useful for viewing the current zone state. To remove the .jnl file after updating the zone file, use rndc sync -clean.
Gruß w.
Member: LordGurke
LordGurke May 24, 2021 at 12:11:09 (UTC)
Goto Top
Oder man lagert alle dynamischen Hosts in eine Sub-Zone aus. Dann hat man dafür getrennte Zonefiles.