1

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.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
David
  • 71
  • 2
  • 4
  • 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. – Gerald Schneider May 04 '23 at 05:15

1 Answers1

1

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

Saxtheowl
  • 1,112
  • 5
  • 8