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.

1
  • 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. May 4, 2023 at 5:15

1 Answer 1

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

2
  • 1
    thanks... I was using named-checkconf and named-checkzone back to front.... just a brain fade
    – David
    Apr 26, 2023 at 12:25
  • 1
    You welcome, dont forget to accept the answer if it fixed your problem :)
    – Saxtheowl
    Apr 26, 2023 at 17:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .