Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to increment serial ? #24

Closed
mickaelmonsieur opened this issue Feb 21, 2020 · 3 comments
Closed

How to increment serial ? #24

mickaelmonsieur opened this issue Feb 21, 2020 · 3 comments
Assignees

Comments

@mickaelmonsieur
Copy link

Hello,
I try to increment serial.

			$zone = $powerdns->zone("test.com");

			if(substr($zone->resource()->getSerial(), 0, 8) == date("Ymd")) {
				$serial = $zone->resource()->getSerial() + 1;
			}
			else {
				$serial = date("Ymd") . '00';
			}

			$zone->resource()->setSerial($serial);

why doesn't it work?
do you have another solution?

@trizz
Copy link
Member

trizz commented Feb 25, 2020

Hi @mickaelmonsieur,

Currently it is not possible to update the SOA serial yourself.

However, it seems that you want to increase it, which will happen automatically when the zone has INCEPTION-INCREMENT configured as a value for SOA-EDIT. At this moment it is not possible to manage this with this package. You can use pdnsutil to check/update the meta of the zone.

@trizz trizz self-assigned this Feb 25, 2020
@mickaelmonsieur
Copy link
Author

Hi @trizz ,
I don't think letting powerdns increase the serial itself makes any sense.
I explain why:
If I add 250 entries in my zone, the server increases 250x the serial? It makes no sense.
I just have to update the serial at the end of all my modifications, don't you think?

@robbinjanssen
Copy link
Member

Hi @mickaelmonsieur, thanks for your issue!

I think it is pdns own advice to update the serial after each change, so therefor we sticked with the default. I like it cause I don't want to worry about the serial update :-)

I'm afraid I don't see us implementing this any time soon, but we're absolutely open for a pull request!

To achieve this a save() method must be created in the Zone class. It should implement the put API call.

Let us know if we can be of any more help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants