Link to home
Start Free TrialLog in
Avatar of ivanvega
ivanvega

asked on

BIND9 rejects my master file because "no TTL specified"...

Hi,

Please take a look at my named.conf file:

options {
        directory "/var/cache/bind";
        pid-file "/var/run/bind/bind.pid";

        auth-nxdomain no;
};
zone "localhost" {type master; file "/etc/bind/db.local";};
zone "127.in-addr.arpa" {type master; file "/etc/bind/db.127";};
zone "0.in-addr.arpa" {type master; file "/etc/bind/db.0";};
zone "255.in-addr.arpa" {type master; file "/etc/bind/db.255";};
zone "mydomain" in {
        type master;
        file "db.mydomain";
        allow-update {192.168.0.101;};
};

and db.mydomain:

$TTL    3h
mydomain. IN SOA dns.mydomain. root@mydomain. (
        1     ; Serial
        3h    ; Refresh after 3 hours
        1h    ; Retry after 1 hour
        1w    ; Expire after 1 week
        1h  ) ; Negative caching TTL of 1 hour
mydomain.  IN NS  dns.mydomain.
localhost.mydomain.  IN A 127.0.0.1
dns.mydomain.       IN A 192.168.0.101
101.0.168.192.in-addr.arpa.  IN PTR dns.mydomain.

"named -g" runs but throws this error:

db.mydomain:1: no TTL specified; zone rejected
zone mydomain/IN: loading master file db.mydomain: no ttl

As you can see, I do have a TTL of 3h so I don't know what's going bad...

Any help is appreciated!

- Ivan
Avatar of harbor235
harbor235
Flag of United States of America image

Check your db.mydomain.com file:

First line should be:

$TTL 3h

thats what I have.


harbor235 ;}

Avatar of ivanvega
ivanvega

ASKER

Makes no difference :)
Did you add in and then restart the daemon?

Yours has additional spaces, delete the line an readd it, then restart the daemon.

harbor235 ;}
I already did that, I'm not that dumb :)
All I see is the line you posted in the question, it has the extra spaces.


good luck,

harbor235 ;}
I mean I already tried what you suggested.

Thanks, I hope I can find a solution.
Try:

$ORIGIN .

$TTL 3600 ; 1 hour in seconds

mydomain. IN SOA dns.mydomain. root@mydomain. (
        1     ; Serial
        3h    ; Refresh after 3 hours
        1h    ; Retry after 1 hour
        1w    ; Expire after 1 week
        1h  ) ; Negative caching TTL of 1 hour

        NS  dns.mydomain.

$ORIGIN mydomain.

$TTL    10800 ; 3 hours in seconds
> mydomain. IN SOA dns.mydomain. root@mydomain. (
@ sign is dissalowed. In SOA definition you have to replace @ with .
mydomain. IN SOA dns.mydomain. root.mydomain. (
SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Turns out bind was using a cached zone file... I'll split it between jar3817, and ravenpl because they helped me solve other side issues.