DNS - serial numbers

Stephen Berg sberg at pangaealink.com
Mon Feb 21 20:19:22 UTC 2000


On Mon, 21 Feb 2000 15:53:14 +0000, Steve Bremner wrote:

>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?
>
>Obviously you can't just wind it back to the lower correct serial
>number, as the secondary servers are depending on the disparity in the
>serial number they have with the one being pushed from the primary, to
>update their own copies of the zone file.

It's a bit tricky but I've done that once.  

This is from O'Reilly's DNS/Bind book (a must have):

Quote:
The other method of fixing the serial number (with 4.9 and later
slaves) will be easier to understand if we first cover some
background material. The DNS serial number is a 32-bit unsigned
integer. Its value ranges from 0 to 4,294,967,295. The DNS serial
number uses sequence space arithmetic, which means that for any
serial number, half of the numbers in the number space (2,147,483,647
numbers) are less than the serial number and half of the numbers are
larger.

Let's go over an example of sequence space numbers. Suppose the
serial number is 5.  Serial numbers (6 - 2,147,483,647) are larger
than serial number 5. Serial numbers (5 + 2,147,483,649) through 4
are smaller serial numbers. Notice that the serial number wrapped
around to 4 after reaching 4,294,967,295. Notice also that we didn't
include the number (5 + 2,147,483,648) because this is exactly
halfway around the number space, and it could be larger or smaller
than 5, depending on the implementation. To be safe, don't use it.

Now back to the original problem. If your zone serial number is
25,000 and you want to start numbering at 1 again, you can speed
through the serial number space in two steps.  First, add the largest
increment possible to your serial number (25,000 + 2,147,483,647 =
2.147,508,647). If the number you come up with is larger than
4,294,967,295 (the largest 32-bit value), you'll have wrap around to
the beginning of tile number space by subtracting 4,294,967,296 from
it. After changing the serial number, you must wait for all of your
secondaries to pick up a new copy of the zone. Second, change the
zone serial number to its target value (1), which is now larger than
the serial number (2,147,508,647).  After the secondaries pick up a
new copy of the zone, you're done!
Unquote.

P.S.  I scanned this in from the book and I think got all the
mistakes my OCR software made.

                            Stephen Berg
//-    USAF Instructor  -/-  Reluctant NT User -/- Web Designer    -//
//-                 Home = sberg at mississippi.com                   -//
//-               Work = berg.stephen at keesler.af.mil               -//
//-     http://iceberg.3c0x1.com/   -/-   http://www.3c0x1.com     -//     





More information about the bind-users mailing list