The sample command:
zone2sql --start-id=10 --zone=/var/cache/bind/test.ps.db
does not respect the --start-id option, and sets it to 0 !! this is not documented either, also their is a minor spelling mistake in the man page ( Use as the forst domain_id generated (defaults to 0).) , i assume its "first".
running pdns-server 126.96.36.199-1 on debian 5.0.4
relevant really old posts on the mailing list:
after looking at the src code, in the function "callback", lastsoa_domain_id is static and initialized by -1 ! this is fine as long as the the first zone id passed is stored in dirty_hack_num and static value of lastsoa_domain_id is incremented accordingly, thus the correct value is used. but what happens when there is no previous zones/domains? which is the case of passing --zone on command line? the desired value is the start-id (which we default to zero), the code sets it to -1 to act as if this is a new zone in a series of zones (from the callback function perspective) it increments and starts at -1 ++, i belive here is the problem ! the value of lastsoa_domain_id initialisation should be start-id minus one , and outputting first soa should be triggered by doing so too (setting dirty_hack_num to start-id minus one) ... im not sure this is the exact meaning of code ... hope it helps!
A reference to a possible solution:
--start-id has been obsoleted by autoincrement behaviour in all supported databases. I will remove start-id from zone2sql shortly.
The --start-id feature is no longer supported in 3.0, so it should have been removed. It might come back later. Removed in 2387.