Howto Check named configuration error

named can’t start its daemon and left me with nothing than confuse.

# /etc/init.d/bind9 restart

* Stopping domain name service… bind9                                                                                     rndc: connect failed: 127.0.0.1#953: connection refused
[ OK ]
* Starting domain name service… bind9                                 [fail]

fail message don’t give a clue, further investigation with named manual lead me to -g and -p .

Retry to see the error message :

# named -g -p 53

22-Jul-2010 07:34:10.333 starting BIND 9.7.0-P1 -g -p 53
22-Jul-2010 07:34:10.333 built with ‘–prefix=/usr’ ‘–mandir=/usr/share/man’ ‘-                                             -infodir=/usr/share/info’ ‘–sysconfdir=/etc/bind’ ‘–localstatedir=/var’ ‘–enable-threads’ ‘–enable-largefile’ ‘–with-libtool’ ‘–enable-shared’ ‘–enable-static’ ‘–with-openssl=/usr’ ‘–with-gssapi=/usr’ ‘–with-gnu-ld’ ‘–with-dlz-postgres=no’ ‘–with-dlz-mysql=no’ ‘–with-dlz-bdb=yes’ ‘–with-dlz-filesystem=yes                                             ‘ ‘–with-dlz-ldap=yes’ ‘–with-dlz-stub=yes’ ‘–with-geoip=/usr’ ‘–enable-ipv6                                             ‘ ‘CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2’ ‘LDFLAGS=-Wl,-Bsymbolic-funct                                             ions’ ‘CPPFLAGS=’
22-Jul-2010 07:34:10.333 adjusted limit on open files from 1024 to 1048576
22-Jul-2010 07:34:10.333 found 4 CPUs, using 4 worker threads
22-Jul-2010 07:34:10.333 using up to 4096 sockets
22-Jul-2010 07:34:10.340 loading configuration from ‘/etc/bind/named.conf’
22-Jul-2010 07:34:10.340 /etc/bind/named.conf.local:16: expected quoted string near ‘.’
22-Jul-2010 07:34:10.341 loading configuration: unexpected token
22-Jul-2010 07:34:10.341 exiting (due to fatal error)

I see, I made mistake in named.conf.local (expected quoted string)

View the error

# nano /etc/bind/named.conf.local

Save the file after editing and start bind9

# /etc/init.d/bind9 start

* Starting domain name service… bind9                                                          [ OK ]
#

Perfecto!