DNS - serial numbers

Alan J Rosenthal flaps at dgp.toronto.edu
Tue Feb 22 00:46:32 UTC 2000


Steve Bremner <sbremner at newbridge.com> writes:
>Anyone know what to do if you realise that on a primary DNS server, you
>have a serial number in a zone file that is higher than it should be?

See section 3.1 of RFC 1912.  The serial number sequence space wraps around,
so you can add 2147483647 (mod 4294967296) (== add 2**31-1 mod 2**32), then
you wait at least two refresh periods, then your desired serial number is
closer (mod 2**32) to the current serial number if crossing zero than if
going the other way around, thus you can switch to your desired serial number.

E.g. you want the serial number 20000221
     you have accidentally used 200000221

Set it to 2347483868 and wait two refresh periods (longer if some of your
secondaries are for some reason not yet transferring the zone).  20000221 is
considered to be higher than 2347483868 (because 2347483868 - 20000221 >
(20000221 + 2**32) - 2347483868) so you can set it to 20000221 now.

Actually my first paragraph is not quite true: if you're higher by just 1
than you want to be, you will have to do this procedure twice.  (Or wait
two days instead!)  And my description of how the wrap-around works has a
similar off-by-one potential error in it; only think of it as I propose above
if the two numbers you're comparing are not close in absolute difference to
2**31, i.e. are not nearly diametrically opposed across the sequence space
circle.

See RFC 1982 for a more careful treatment of this serial number sequence
space arithmetic.

Incidentally, when updating a zone more than once in a single day, I just
increment, so the serial number gets ahead of the date.  BFD.  On the other
hand, that might be too informal for larger sites.



More information about the bind-users mailing list