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
Linux Networking

Avatar of undefined
Last Comment
ivanvega

8/22/2022 - Mon
harbor235

Check your db.mydomain.com file:

First line should be:

$TTL 3h

thats what I have.


harbor235 ;}

ivanvega

ASKER
Makes no difference :)
harbor235

Did you add in and then restart the daemon?

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

harbor235 ;}
Your help has saved me hundreds of hours of internet surfing.
fblack61
ivanvega

ASKER
I already did that, I'm not that dumb :)
harbor235

All I see is the line you posted in the question, it has the extra spaces.


good luck,

harbor235 ;}
ivanvega

ASKER
I mean I already tried what you suggested.

Thanks, I hope I can find a solution.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
giltjr

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
ravenpl

> 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
ravenpl

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ivanvega

ASKER
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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck