checkzone from stdin?

Grant Taylor gtaylor at
Wed Apr 8 20:22:56 UTC 2020

On 4/8/20 1:55 PM, Anand Buddhdev wrote:
> named-checkzone wants a file, so give it a "file":
> named-checkzone /dev/stdin <

You might also consider <(...) files.

    named-checkzone <(cat

> Note that it would work with "cat file | ..." but I absolutely hate 
> the cat-pipe combination. I've been known to mark down interviewees 
> who offer a solution that involves cats and pipes :)

Is cat superfulous, probably.  But I'm quite willing to overlook the 
useless use of cat if it's a junior admin who's still learning about 
stringing commands together.

I'll give a nod of approval if someone says something to the effect of:

    Yes, I can remove cat and redirect in from the file, but that 
changes the command, slightly, from what would be used elsewhere. 
Seeing how cat tempfile is a stand in for a larger more resource 
intensive purpose....

I digress.

> If you want to feed a compressed zone file, then of course a 
> gzcat-pipe combination will work, eg:
> gzcat | named-checkzone /dev/stdin

    named-checkzone <(gzcat

> Finally, if you're running your scripts under bash, then bash offers 
> a very neat feature:

More than just Bash supports it.

I've been using it in Zsh for years.  And bash for years before switching.

> named-checkzone <(gzcat
> The "<(...)" construct in bash runs the command inside the parantheses,
> and sends its output to an ephemeral file of the form /dev/fd/42. So the
> above command becomes:
> named-checkzone /dev/fd/42
> and named-checkzone reads the "file" /dev/fd/42, getting the
> decompressed data.

Thank you for the detailed explanation.

Grant. . . .
unix || die

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4013 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the bind-users mailing list