How to identify a "raw" zone file

Jan-Piet Mens jpmens.dns at gmail.com
Fri Dec 2 08:06:03 UTC 2011


> I'd recommend checking the next four octets as well; they'll be "00 00 00 00"
> or "00 00 00 01".

I've hacked up a magic(5) file which seems to work for me:

        $ file *
        inline.aa:            BIND raw format zone file < v9.9
        inline.aa.jnl:        BIND journal file v9
        inline.aa.signed:     BIND raw format zone file < v9.9
        inline.aa.signed.jnl: BIND journal file v9

I'm attaching the file I dropped into /usr/share/file/magic/

        -JP

-------------- next part --------------
#------------------------------------------------------------------------------
# bind:  file(1) magic for BIND zone file binary formats

#
# By JP Mens from information given by Evan Hunt
# > I've looked at a few of them, and I noticed that all the ones I've seen
# > start with the four-octet string "00 00 00 02".  Is that sufficient?
# 
# I'd recommend checking the next four octets as well; they'll be "00 00 00 00"
# or "00 00 00 01".  The first of those is the format that's always been used
# up to now; the second is the format that will be used in 9.9.0, starting
# with the next beta.
#
0	belong		&0x00000000	BIND raw format zone file
>4	belong		&0x00000000	< v9.9
>4	belong		&0x00000001	>= v9.9

0	string		;BIND\ LOG\ V9	BIND journal file v9


More information about the bind-users mailing list