Highlights your Bind9 named.conf
(and zones and its include files) in
vim editor session.
Uses 4-bit (16-color) Vim color scheme. Supports light/dark theme too.
To quickly see nearly all permutation of Bind9 named.conf configuration settings , run:
vim test/example-9.16-named.conf
This is where most of my animated GIF came from.
This project aims to replace the stock Vim syntax highlighting for ISC Bind
(named.vim
), by updating it to recognize the new RRs that came out in
the last few decade and also to highlight more clauses/statements/keywords that ISC Bind9 has incorporated as of late.
As comment lines throughout this bind-named.vim
syntax file, I incorporate
nearly all the revised psuedo-BNF syntax for every named.conf
statement
keywords encountered. These psuedo-BNF syntax may (often) not match the
official ISC Bind documentation because its C source code
takes final precedence here.
October 16, 2021
Original release
named.conf
keywords supportedrndc.conf
Filetype detectionrndc.key
named-*.conf
from named*.conf
named_*.conf
from named*.conf
named.*.conf
from named*.conf
*-named.conf
*_named.conf
*.named.conf
rndc_*.conf
rndc-*.conf
rndc.*.conf
*_rndc.conf
*-rndc.conf
*.rndc.conf
The rndc.conf
is now supported (along with its filename variants, as long as
as the filename portion begins with rndcX
or ends with Xrndc
and the letter
X signifies a period, an underscore, or a dash/minus symbol.
There's a namedXXXXX.conf out there being used by a database so I figured we constrained it a bit with a dash, an underscore, or a period symbol.
In my huge internal whitelab bastion server, I run two separate named daemon
and its configuration files, they all get included into their respective
named-XXXX.conf
:
/etc/bind/named-public.conf
/etc/bind/public/acl-named.conf
/etc/bind/public/channels-named.conf
/etc/bind/public/controls-named.conf
/etc/bind/public/dnssec-keys-named.conf
/etc/bind/public/masters-named.conf
/etc/bind/public/options-named.conf
/etc/bind/public/servers-named.conf
/etc/bind/public/statistics-named.conf
/etc/bind/public/view.red
/etc/bind/rndc-public.conf
/etc/bind/named-internal.conf
/etc/bind/internal/options-named.conf
/etc/bind/internal/acl-named.conf
/etc/bind/internal/channels-named.conf
/etc/bind/internal/controls-named.conf
/etc/bind/internal/masters-named.conf
/etc/bind/internal/view.red
/etc/bind/internal/view.dmz
/etc/bind/internal/view.yellow
/etc/bind/internal/view.green
/etc/bind/rndc-internal.conf
Imagine my surprise in the current Bind version that ACL names can support some form of Python/C/C++ language array naming convention.
Yeah, ACL names like:
acl my_firewall[red][zoom] { acl_conference_rooms; };
acl my_firewall[red][facetime] { acl_conference_rooms; };
acl my_firewall[red][signal] { acl_conference_rooms; };
Pretty cool, uh?
The following patterns for IPv6 addresses are supported:
I plan to:
replace the stock Vim bindzone.vim
, but that is something that I
would welcome anyone to submit ... easily.
Instead, I'm focused on doing this hard problem of creating these
syntaxes for bind-named.vim
(Bind named configuration file).
make this work steadily across ALL versions of Bind, but in starting with the current v9.16 and then OUTWARD toward v4 and v10: I managed to do this mostly.
NOT to make a Vim bundle zip file (for remote upgrading/downloading): I work offline and my whitelab is offline, so someone else is more than welcome to do the bunzip'ing.
make the FINAL CALL here for this syntax development using its C source code. Mistakes will be made: I'm human too. ISC Bind9 documentation project is not something to rely on when devising this VIM syntax for its named configuration file. I do have ALL released (and some minor) versions of Bind4, Bind8, Bind9, and Bind10 documentation as well as its source code.
I maintain those lifetime of keywords for named.conf
and its many
characteristics into my Pythonized ISC Bind keyword dictionary maintained over
at egberts' repo at Github.
Some Python database characteristics for each keywords are:
If you have any issues with this syntax file, see if you can:
pay attention to the closing semicolon and ensure that it is highlighted as soft or light green. If the semicolon is dark-cyan, then that is the point of syntax failure.
keep narrowing down the offending line until it stopped offending, hopefully
it is just to just one (or few) lines. No need to expose your entire named.conf
Don't forget to change all IP addresses (unless that breaks too) for
your privacy sake.
post/file the offending line over at my Github issue.
detail the wrong highlight and state what you think is to be its correct highlight, if applicable.
If you are bold enough to try your hand on debugging Vim syntax file, see my DEBUG.md on how to debug a Vim syntax file.
See INSTALL.md on how to install this Vim syntax to your local Vim settings.
Note to Vim developers: During the prototyping of my IPv6 address syntax matching, I noticed that vim 8.1 can only support a maximum of 9 groupings of parenthesis, even if I used the "\%( ... )" notation (instead of "( ...)").
As a result of this Vim limitation, I've had to duplicate IPv6 match patterns through this syntax file to get around this vim 8.1 limitation. But it works and faster so.