Score:1

named-checkconf throwing error on previously functioning forward zone file

ru flag

I wanted to add a zone to my bind9 configuration (BIND 9.16.1). I have about 20 domains serviced by this name server, most of which have worked for > 10 years.

named-checkconf is throwing errors on the new conf file, but also all the old conf files, even though they still work. I'm not brave enough to reload bind9 in case I am missing something.

I get the following error:

root@ns:/var/cache/bind# named-checkconf test
test:1: unknown option '$ORIGIN'
test:18: unexpected token near end of file
root@ns:/var/cache/bind# cat test
$ORIGIN test.au.
$TTL 3h
@   IN  SOA ns1.example.com.au. david.example.com.au. (
            23042601    # serial
            3h      # refresh
            15m     # retry
            14d     # expire
            12h     # default_ttl
            )
@   IN  NS  ns1.example.com.au.
@   IN  NS  ns2.example.com.au.
@   IN  MX  50  mail.test.au.
@   IN  MX  100 ns.example.com.au.
@   IN  A   123.456.789.1
mail    IN  A   123.456.789.9
www IN  A   123.456.789.1
 
root@ns:/var/cache/bind#

If I put a comment at the beginning, i get a different error thus:

root@ns:/var/cache/bind# named-checkconf test
test:1: syntax error near ';'
root@ns:/var/cache/bind# cat test
; 230426 original
;
$ORIGIN test.au.
$TTL 3h
@   IN  SOA ns.example.com.au.  david.example.com.au. (
etc......

I feel like I'm missing something obvious.

in flag
Please don't just add `solved` to your question, instead accept the answer that helped you, this will mark the question as solved in the system. You can do that by clicking on the checkmark on the left side of the answer.
Score:1
by flag

You are running named-checkconf on a zone file but named-checkconf was made to validate the configuration file like named.conf, just use named-checkzone instead.

you should run it like that named-checkzone test.au test

David avatar
ru flag
thanks... I was using named-checkconf and named-checkzone back to front.... just a brain fade
Saxtheowl avatar
by flag
You welcome, dont forget to accept the answer if it fixed your problem :)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.