Emacs DNS Mode

Published 2011-07-07

When updating bind zone files, I often forget to bump the serial number. If you’ve been there, you know that leads to subtle and not-so-subtle stupidities…

Over the years I’ve added pre-commit hooks to watch my back, and that works and is a good fail-safe. But there is another way…

Emacs, of course, having been used to edit bind zone files since day one, has the answer – I just didn’t know where to look. Using dns-mode adds a ‘before save’ hook that bumps the serial number in, what is to me, a familiar format: YYYYMMDDNN, where NN is bumped with each save on the same day.

If you are bothered by a few extraneous bumps due to multiple saves, you can be explicit about when to bump using C-c C-s which runs dns-mode-soa-increment-serial.

Emacs FTW. As always…