Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Editing BIND files with emacs: which mode?

293 views
Skip to first unread message

Stephane Bortzmeyer

unread,
Sep 19, 2008, 11:21:56 AM9/19/08
to
It seems ("bind emacs" is not a good search string in a search engine
:-) that there is no Emacs mode for either BIND configuration files or
for zone files.

For configuration files, the generic "conf-*" modes are OK, for
instance conf-javaprop-mode is quite reasonable.

But for zone files?

Niall O'Reilly

unread,
Sep 19, 2008, 12:34:16 PM9/19/08
to

The built-in Emacs search engine (C-h a) returns the
following when I type "zone" as the search argument.

zone <menu-bar> <tools> <games> <zone>
Command: Zone out, completely.
zone-mode M-x zone-mode RET
Command: A mode for editing DNS zone files.
zone-mode-update-serial M-x zone-mode-update-serial RET
Command: Update the serial number in a zone.
zone-mode-update-serial-hook M-x zone-mode-update-serial-hook RET
Command: Update the serial number in a zone if the file was modified

I guess the first one is outside your scope.

I've used zone-mode implicitly for years, and supposed
"everyone knew". Emacs just does the "right thing"; I'm not
sure what heuristic it uses. Perhaps naming my files like
"ucd.ie.zone" is what triggers it. I really like the
automatic serial update: no extra reload because I've
forgotten, as used to happen when I used a different editor.

Have a good weekend.
/Niall

Stephane Bortzmeyer

unread,
Sep 19, 2008, 12:55:10 PM9/19/08
to
On Fri, Sep 19, 2008 at 05:34:16PM +0100,
Niall O'Reilly <Niall....@ucd.ie> wrote
a message of 35 lines which said:

> The built-in Emacs search engine (C-h a) returns the
> following when I type "zone" as the search argument.

> zone-mode M-x zone-mode RET


> Command: A mode for editing DNS zone files.

Great, thanks.

> I've used zone-mode implicitly for years, and supposed
> "everyone knew". Emacs just does the "right thing"; I'm not
> sure what heuristic it uses.

I name my files just "example.org" and it apparently does not trigger
anything. Yes, ".zone" at the end seems the proper trick.


Rob Austein

unread,
Sep 19, 2008, 1:19:57 PM9/19/08
to
At Fri, 19 Sep 2008 18:55:10 +0200, Stephane Bortzmeyer wrote:
>
> > I've used zone-mode implicitly for years, and supposed
> > "everyone knew". Emacs just does the "right thing"; I'm not
> > sure what heuristic it uses.
>
> I name my files just "example.org" and it apparently does not trigger
> anything. Yes, ".zone" at the end seems the proper trick.

(setq auto-mode-alist (cons '("\\.org$" . zone-mode) auto-mode-alist))

Kevin Darcy

unread,
Sep 19, 2008, 5:19:20 PM9/19/08
to
Stephane Bortzmeyer wrote:
> It seems ("bind emacs" is not a good search string in a search engine
> :-) that there is no Emacs mode for either BIND configuration files or
> for zone files.
>
> For configuration files, the generic "conf-*" modes are OK, for
> instance conf-javaprop-mode is quite reasonable.
>
> But for zone files?
>
Well, if some of the EMACS partisans are to be believed, there's no
doubt some 2-line macro that enables EMACS to function as a full
authoritative nameserver and/or recursive resolver, along with full
Dynamic Update and DNSSEC support, so it would be pretty easy to use it
for managing your DNS once that macro is activated :-)

- Kevin


Stephane Bortzmeyer

unread,
Sep 22, 2008, 3:05:34 AM9/22/08
to
On Fri, Sep 19, 2008 at 01:19:57PM -0400,
Rob Austein <Rob_A...@isc.org> wrote
a message of 10 lines which said:

> (setq auto-mode-alist (cons '("\\.org$" . zone-mode) auto-mode-alist))

Next step: since I do not manage only ".org" domains, write an Emacs
Lisp function which will download the list of TLD from IANA Web site
and add them to auto-mode-alist. Bonus: handle the case of Poland for
Perl scripts and Paraguay for Python scripts.

I think I'll rather change my naming rules :-)

Niall O'Reilly

unread,
Sep 22, 2008, 6:17:48 AM9/22/08
to
On Fri, 19 Sep 2008 17:55:10 +0100, Stephane Bortzmeyer
<bortz...@nic.fr> wrote:

> I name my files just "example.org" and it apparently does not trigger
> anything. Yes, ".zone" at the end seems the proper trick.

Or you can keep naming the files the way you like, and
put some magic words for Emacs in a comment.

; -*- mode: zone -*-
$ORIGIN example.org.
@ 86400 IN SOA dummy.example.org. hostmaster.example.org. (
2008092200
28800
14400
3600000
14400
)
; or whatever

[ And yes, I haven't thought about those timer values
in a long time. ]

/Niall

0 new messages