It’s early mornings here, and I’ve not [yet] opened a bottle, and to my knowledge I’ve not caught the pest, but the words in the title are related to each other. How?
If you look closely at the dig
syntax on that oh-so lovely towel ISC have in their merchandise shop (click on the towel) you’ll notice an optional %comment
at the end of the command. I remembered that from way back but also remembered that I never actually bothered to find out what that even did.
Winfried asked and I woke up our friends at ISC to find out. Turns out the percent sign really does introduce a comment and has been in the code since BIND 8.
The syntax on the towel still is in the fabulous BIND 9 ARM but isn’t explained, and dig(1)
man pages no longer even bother mentioning it.
From a current dig.c
:
rc = argc;
rv = argv;
for (rc--, rv++; rc > 0; rc--, rv++) {
debug("main parsing %s", rv[0]);
if (strncmp(rv[0], "%", 1) == 0) {
break;
}
...
(Let’s ignore the renaming of argc
and argv
(saving a few characters on each), and let’s also ignore using strncmp
to check the first character of a variable, ok?)
So what does it do? Nothing. It is a comment and inhibits further parsing of the command line:
$ dig jpmens.net %rest-is-ignored +dnssec
The +dnssec
flag is unused.
The assumption is that it could be used in batch files, maybe before the advent of shell scripts (which have their own comment sign), or (gasp!) in digrc
files.
And seeing you made it this far, you might also be interested to learn why zone master files use a semicolon for comments.