# BIND 9 Error startup

## phillosophy

After emerging and configuring a single internet domain for bind, I get the following error when I attempt to startup named.  Any idea how i can correct this?  Thanks in advance 

```
May 29 08:31:58 getz named[6214]: starting BIND 9.2.5

May 29 08:31:58 getz named[6214]: using 1 CPU

May 29 08:31:58 getz named[6214]: loading configuration from '/etc/bind/named.conf'

May 29 08:31:58 getz named[6214]: /etc/bind/named.conf:9: expected IP address near 'other.$

May 29 08:31:58 getz named[6214]: loading configuration: unexpected token

May 29 08:31:58 getz named[6214]: exiting (due to fatal error)

May 29 09:17:23 getz rc-scripts: /sbin/rc-update: /etc/init.d/apache not found; aborting.

May 29 11:02:36 getz named[31925]: starting BIND 9.2.5 -u named -n 1

May 29 11:02:36 getz named[31925]: using 1 CPU

May 29 11:02:36 getz named[31925]: loading configuration from '/etc/bind/named.conf'

May 29 11:02:36 getz named[31925]: /etc/bind/named.conf:9: expected IP address near 'other$

May 29 11:02:36 getz named[31925]: loading configuration: unexpected token

May 29 11:02:36 getz named[31925]: exiting (due to fatal error)

```

Here is my named.conf file : 

```
options {

        directory "/var/bind";

        statistics-file "/var/bind/named.stats";

        dump-file "/var/log/named.dump";

        zone-statistics yes;

        allow-recursion { 127.0.0.1; 10.0.0.0/8; };

        allow-transfer { other.name.servers; };

        notify yes;

        also-notify { other.name.servers; };

        pid-file "/var/run/named/named.pid";

        recursive-clients 10000; // default 1000 is too low for us

        serial-query-rate 10; // default 20

        max-transfer-time-in 60; // kills transfers after 60 minutes

        transfer-format many-answers; // Generates more efficient zone transfers

        interface-interval 0; // we have no dynamic interfaces

        // uncomment the following lines to turn on DNS forwarding,

        // and change the forwarding ip address(es) :

        //forward first;

        //forwarders {

        //      123.123.123.123;

        //      123.123.123.123;

        //};

        listen-on-v6 { none; };

        listen-on { 127.0.0.1; };

        // to allow only specific hosts to use the DNS server:

        //allow-query {

        //      127.0.0.1;

        //};

        // if you have problems and are behind a firewall:

        //query-source address * port 53;

        pid-file "/var/run/named/named.pid";

};

logging {

  channel default_file { file "/var/log/named/default.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel general_file { file "/var/log/named/general.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel database_file { file "/var/log/named/database.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel security_file { file "/var/log/named/security.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel config_file { file "/var/log/named/config.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel resolver_file { file "/var/log/named/resolver.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel xfer-in_file { file "/var/log/named/xfer-in.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel xfer-out_file { file "/var/log/named/xfer-out.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel notify_file { file "/var/log/named/notify.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel client_file { file "/var/log/named/client.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel unmatched_file { file "/var/log/named/unmatched.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel queries_file { file "/var/log/named/queries.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel network_file { file "/var/log/named/network.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel update_file { file "/var/log/named/update.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel dispatch_file { file "/var/log/named/dispatch.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel dnssec_file { file "/var/log/named/dnssec.log" versions 3 size 5m;

severity dynamic; print-time yes; };

  channel lame-servers_file { file "/var/log/named/lame-servers.log" versions 3

size 5m; severity dynamic; print-time yes; };

  category default { default_file; };

  category general { general_file; };

  category database { database_file; };

  category security { security_file; };

  category config { config_file; };

  category resolver { resolver_file; };

  category xfer-in { xfer-in_file; };

  category xfer-out { xfer-out_file; };

  category notify { notify_file; };

  category client { client_file; };

  category unmatched { unmatched_file; };

  category queries { queries_file; };

  category network { network_file; };

  category update { update_file; };

  category dispatch { dispatch_file; };

  category dnssec { dnssec_file; };

  category lame-servers { lame-servers_file; };

};

zone "." IN {

        type hint;

        file "named.ca";

};

//include to actual zone files

include "/var/bind/conf/jesus.conf";

zone "localhost" IN {

        type master;

        file "pri/localhost.zone";

        allow-update { none; };

        notify no;

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127.zone";

        allow-update { none; };

        notify no;

};

```

----------

## overkll

Can you post your config files - named.conf, zone and reverse zone files (whatever you named them)

----------

## phillosophy

here is my zone file 

```
$TTL 3D

streamingforjesus.com       IN      SOA     ns1.streamingforjesus.com.

webmaster.jesusstreamingmedia.com.  (

                                      2005052801 ; Serial

                                      8H         ; Refresh

                                      2H         ; Retry

                                      4W         ; Expire - 1 week

                                      1D    )    ; Minimum

                TXT     "Streaming For Jesus"

streamingforjesus.com.          IN      A      192.168.1.102

www.streamingforjesus.com.      IN      CNAME   streamginforjesus.com.

ns.streamingforjesus.com.       IN      A      192.168.1.102

ns2.streamingforjesus.com.      IN      A       192.168.1.102

streamingforjesus.com.          IN      NS      ns.streamingforjesus.com.

streamingforjesus.com.          IN      NS      ns2.streamingforjesus.com.

mail.streamingforjesus.         IN      MX      1 streamingforjesus.com.

ftp.streamingforjesus.com.      IN      CNAME   streamingforjesus.com.

mail.streamingforjesus.com.     IN      CNAME   streamingforjesus.com.

```

127.zone file 

```
$ORIGIN 127.in-addr.arpa.

$TTL 1W

@                       1D IN SOA       localhost. root.localhost. (

                                        2002081601      ; serial

                                        3H              ; refresh

                                        15M             ; retry

                                        1W              ; expiry

                                        1D )            ; minimum

                        1D IN NS        localhost.

*                       1D IN PTR       localhost.

```

----------

## overkll

 *Quote:*   

> options {
> 
>         directory "/var/bind";
> 
>         statistics-file "/var/bind/named.stats";
> ...

 

 *Quote:*   

> May 29 08:31:58 getz named[6214]: /etc/bind/named.conf:9: expected IP address near 'other.$

 

I don't see an acl defining "other.name.servers".  Try defining them by IP address.  You may just have to stick to defining them by IP address.

----------

## phillosophy

do i even need the allow-transfer and also-notify server entires?  Also, do I also need the pid-file entries as well?

----------

## overkll

Only if you intend to run secondary name servers.  I'd keep the PID file

I also noticed that your "listen-on" entry is limited to 127.0.0.1.  If you want externel machines to be able to connect you'll have to add the IP address a valid ethernet card of the server

----------

## phillosophy

I changed the options to the following: 

```
options {

        directory "/var/bind";

        statistics-file "/var/bind/named.stats";

        dump-file "/var/log/named.dump";

        zone-statistics yes;

        allow-recursion { 127.0.0.1; 10.0.0.0/8; };

        allow-transfer { 192.168.1.102; };

        notify yes;

        also-notify { 192.168.1.102; };

        pid-file "/var/run/named/named.pid";

        recursive-clients 10000; // default 1000 is too low for us

        serial-query-rate 10; // default 20

        max-transfer-time-in 60; // kills transfers after 60 minutes

        transfer-format many-answers; // Generates more efficient zone transfers

        interface-interval 0; // we have no dynamic interfaces

```

now i get the following error in my log.  Are there other places where the pid file would be defined?  thanks for all the help so far. 

```

May 29 11:02:36 getz named[31925]: starting BIND 9.2.5 -u named -n 1

May 29 11:02:36 getz named[31925]: using 1 CPU

May 29 11:02:36 getz named[31925]: loading configuration from '/etc/bind/named.conf'

May 29 11:02:36 getz named[31925]: /etc/bind/named.conf:9: expected IP address near 'other.name.servers'

May 29 11:02:36 getz named[31925]: loading configuration: unexpected token

May 29 11:02:36 getz named[31925]: exiting (due to fatal error)

May 29 11:57:23 getz named[32005]: starting BIND 9.2.5 -u named -n 1

May 29 11:57:23 getz named[32005]: using 1 CPU

May 29 11:57:23 getz named[32005]: loading configuration from '/etc/bind/named.conf'

May 29 11:57:23 getz named[32005]: /etc/bind/named.conf:36: 'pid-file' redefined near 'pid-file'

May 29 11:57:23 getz named[32005]: loading configuration: already exists

May 29 11:57:23 getz named[32005]: exiting (due to fatal error)

```

----------

## overkll

You've got the pid file defined twice in named.conf.  Delete one of them and give it another go.

----------

## phillosophy

Cool.  that seemed to fix the pid problem and named seems to be starting now; however, in the messages, i still get the following error: 

```

May 29 12:56:16 getz named[32223]: starting BIND 9.2.5 -u named -n 1

May 29 12:56:16 getz named[32223]: using 1 CPU

May 29 12:56:16 getz named[32223]: loading configuration from '/etc/bind/named.conf'

May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:109: unknown option ')'

May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:112: unknown option 'zone'

May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:119: unknown option 'zone'

May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:127: '}' expected near end of file

May 29 12:56:16 getz named[32223]: loading configuration: unexpected token

May 29 12:56:16 getz named[32223]: exiting (due to fatal error)

```

Do I need to add anything to the zone section of the named.conf file?  

```
zone "." IN {

        type hint;

        file "named.ca";

};

zone "streamingforjesus.com" IN {

        type master;

        file "jesus/streamingforjesus.com";

);

zone "localhost" IN {

        type master;

        file "pri/localhost.zone";

        allow-update { none; };

        notify no;

};

zone "127.in-addr.arpa" IN {

        type master;

        file "pri/127.zone";

        allow-update { none; };

        notify no;

};

```

----------

## overkll

 *Quote:*   

> May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:109: unknown option ')'
> 
> May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:112: unknown option 'zone'
> 
> May 29 12:56:16 getz named[32223]: /etc/bind/named.conf:119: unknown option 'zone'
> ...

 

These are probably syntax errors.  Probably missed a beginning or end bracket somewhere around / between lines 109 and 127.

If you are planning reverse lookups, you'll need a zone for that - both the actual zone file and the zone entry in named.conf for that reverse zone.

----------

## phillosophy

awesome, I got the following output : 

```
May 29 13:29:45 getz named[32374]: starting BIND 9.2.5 -u named -n 1

May 29 13:29:45 getz named[32374]: using 1 CPU

May 29 13:29:45 getz named[32374]: loading configuration from '/etc/bind/named.conf'

May 29 13:29:45 getz named[32374]: no IPv6 interfaces found

May 29 13:29:45 getz named[32374]: listening on IPv4 interface lo, 127.0.0.1#53

May 29 13:29:45 getz named[32374]: command channel listening on 127.0.0.1#953

```

Because the command channel is listening on 127.0.0.1, do I need to change that to an internet IP address if i plan on running the dns server for my webserver on the internet?

----------

## overkll

Yes, you do.  I think I mentioned that earlier.  

 *Quote:*   

> I also noticed that your "listen-on" entry is limited to 127.0.0.1. If you want externel machines to be able to connect you'll have to add the IP address a valid ethernet card of the server

 

I highly recommend a reverse zone as well (PTR records).  You'll also have to change the private IP addresses to public ones or no one will be able to connect from outside your network.

BTW, where did you get that MONSTER named.conf file?

----------

## phillosophy

sorry, an oversight on my part.  Right now I'm just trying to get the box working until I can get my internet ip addresses for the name server.  Because I want to use the same box for both ns and ns1 name servers, how would I go about adding a second ip address?  

I added the zone : 

```
zone "1.168.192.in-addr.arpa" in {

        type master;

        file "db.192.168.1";

}

```

with the reverse lookup file containing : 

```
$TTL 3h 

@ IN SOA hostname.streamingforjesus.com. webmaster.streamingforjesus.com. ( 

                              1                   ; serial 

                              3h                 ; refresh after 3 hrs 

                              1h                 ; retry in 1 hr 

                              1w                 ; expire in 1 wk 

                              1h )               ; negative caching ttl of 1 hr 

 IN NS getz.streamingforjesus.com. 

IN PTR getz.streamingforjesus.com. 
```

I got the named.conf file off of this forum.

----------

## overkll

No problem

```
listen-on { 127.0.0.1; 192.168.1.102; };
```

The named.conf zone entry looks fine.

 *Quote:*   

> Code:
> 
> $TTL 3h
> 
> @ IN SOA hostname.streamingforjesus.com. webmaster.streamingforjesus.com. (
> ...

 

----------

## phillosophy

cool 

Because I will be running a postfix mail server on the same box, will I necessarily need to add an MX record to the namd.conf file ?

----------

## overkll

Nope.  MX records go in your zone file.

Since you obtained the named.conf file from someone else, you probably want to check and make sure there is nothing in the file that belongs to the original owner i.e. IP addresses.

----------

## phillosophy

I'll be sure to do that.  thanks again for all your help.  Any suggestions or pointers before I install the mail server?

----------

## phillosophy

To test this name server locally, shouldn't it work if I just set a local workstation's dns settings to ns.streamingforjesus.com and typed in www.streamingforjesus.com in the browser?

----------

## overkll

Yes,  Check out the Bind Administrator's Manual.  It's online, but if you emerge bind with the USE flag "doc", portage will put it in your /usr/share/doc/bind-version directory.

Also check to make sure your new bind installation is working.  If you haven't already emerged bind-tools do so.  Then do "dig yahoo.com" or anyother domain on the net and see your results.

Learn how to use "rndc"

Postfix is a great choice for a mail server.  Powerful, secure, and flexible.  Most importantly is still a live project.

----------

## phillosophy

because i'm just using one server for a name server, would I benefit  that much from using a rndc.conf file ?

----------

## overkll

I just meant the command.  You can toggle logging on and off, dump the database to a file, and stuff like that.

----------

## phillosophy

oh ok, thanks again

----------

## overkll

You're welcome!  Good Luck!

----------

