2

I can't figure out how to list dynamically added DNS records. Lets say I add a record like this:

~$ nsupdate
> update add test.domain.com 3600 A 1.2.3.4
> send

After this I can look up the sub domain test.domain.com with:

~$ dig test.domain.com

And I get the correct info. But this entry doesn't show in the zone-file like the manually added records.

How do I know what records have been added dynamically if I can't see them anywhere?

Using Bind 9.10.3

PatricF
  • 163
  • 1
  • 2
  • 7

2 Answers2

5

My apologies for quoting the manual verbatim, but they are probably better writers than I am https://ftp.isc.org/www/bind/arm95/Bv9ARM.ch04.html

In short: the zone file is not the absolute thruth when allowing dynamic updates.

All changes made to a zone using dynamic update are stored in the zone's journal file. This file is automatically created by the server when the first dynamic update takes place. The name of the journal file is formed by appending the extension .jnl to the name of the corresponding zone file unless specifically overridden. The journal file is in a binary format and should not be edited manually.

The server will also occasionally write ("dump") the complete contents of the updated zone to its zone file. This is not done immediately after each dynamic update, because that would be too slow when a large zone is updated frequently. Instead, the dump is delayed by up to 15 minutes, allowing additional updates to take place.

....

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.

If you have to make changes to a dynamic zone manually, the following procedure will work: Disable dynamic updates to the zone using rndc freeze zone. This will also remove the zone's .jnl file and update the master file. Edit the zone file. Run rndc thaw zone to reload the changed zone and re-enable dynamic updates.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
0

Bind needs to be restarted to show up in the zone-file for some reason. A reload wasn't sufficient.

marsh-wiggle
  • 2,145
  • 5
  • 29
  • 45
PatricF
  • 163
  • 1
  • 2
  • 7