1826496 Members
3169 Online
109692 Solutions
New Discussion

Re: bind 9

 
Hendra_3
Occasional Advisor

bind 9

hello,
If master for secondary zone [ABC] unreachable for a long time, and the secondary zone [ABC] expired. Will this secondary server respond query for [ABC]?
Any RFCs standard for this issue?

Thanks.
8 REPLIES 8
Hendra_3
Occasional Advisor

Re: bind 9

Here is the query result after master down, secondary expired. SERVFAIL!

WHY?

# dig -t soa nomaster.com
; <<>> DiG 9.2.1 <<>> -t soa nomaster.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 27285
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
U.SivaKumar_2
Honored Contributor

Re: bind 9

Hi,

If you have not included file directive in named.conf for that secondary then the records from master is saved in memory only. So after expiry time the slave will not answer the queries.

So to configure a backup file for holding the records from master configure named.conf like this

zone "mydomain.com" in {
type slave;
file "db.mydomain.com";
masters { xxx.xxx.xxx.xxx; };
};

Restart the named daemon. Now the slave server fetches the data from master server and will store it in the file db.mydomain.com under default /var/named directory. So in case the master goes down , the slave will able to answer the data from the file db.mydomain.com.

regards,
U.SivaKumar



Innovations are made when conventions are broken
Hendra_3
Occasional Advisor

Re: bind 9

Yes.
I tried it before.

named.conf in master(ns1):
zone "nomaster.com" IN {
type master;
file "nomaster.com";
allow-transfer { ns2; };
};

named.conf in ns2
zone "nomaster.com" IN {
type slave;
file "nomaster.com";
masters { ns1 ; };
};

I set TTL 60 seconds,
and let master down.

After 5 minutes, ns2 will get
Feb 25 named[5726]: zone nomaster.com/IN: refresh: unexpected rcode (SERVFAIL) from master x.x.x.x#53

After 5 minutes, I query
#dig -t soa nomaster.com
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 52969

all because of TTL expired @ns2, and ns1 is down.
U.SivaKumar_2
Honored Contributor

Re: bind 9

Hi,

Is the backup file created after a zone transfer ?

Did you check the contents of the backfile ?


regards,
U.SivaKumar
Innovations are made when conventions are broken
Steven E. Protter
Exalted Contributor

Re: bind 9

I'm not sure BIND is working on any of your servers.

You might want to look at the mechanics of how you built the zone.

I'm uploading a working example of named.conf and one of the zone files.

Here goes.

named.conf attached.

Here is one of my zones, taken at random, as referenced in the named.conf file.
$TTL 86400
@ IN SOA @ investmenttool.com (
4 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)


@ IN NS dns1.investmenttool.com.
@ IN NS dns2.investmenttool.com.
@ IN MX 10 investmenttool.com. ; primary mail exchanger

@ A 66.92.143.194
www A 66.92.143.194
news A 66.92.143.194
shell A 66.92.143.194
smtp A 66.92.143.194
dns1 A 66.92.143.194
dns2 A 66.92.143.194

quote A 66.92.143.194

jerusalem CNAME investmenttool.com.
localhost CNAME investmenttool.com.
ftp CNAME investmenttool.com.
mail CNAME investmenttool.com.


service named stop
service named start

after getting the servers working properly.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Hendra_3
Occasional Advisor

Re: bind 9

thanks for your reply steven.

Actually, my question is whether secondary server can take over primary server when the primary is down for a loooooong period of time.



Hendra_3
Occasional Advisor

Re: bind 9

Hi, SivaKumar

The file, "nomaster.com" has been created in ns2 before the primary dns down.
and the contents is OK.

My TEMPORARY solution when primary dns is down is...

setting on secondary dns
[BEFORE]
zone "masterisdown.com" IN {
type slave;
file "masterisdown.com";
masters { x.x.x.x ; };
};

[AFTER]
zone "masterisdown.com" IN {
type master;
file "masterisdown.com";
allow-update { none; };
};

then restart the service.

I think it's the real dns. when primary is down, the secondary is waiting to TTL expired then down too.

But nobody knows. Everyone think that slave will take over and responsible for queries when the master down forever.
snooq
New Member

Re: bind 9

slave with zone file will respond query as long as it does not expire.

Expiration (not TTL), by default (in BIND), is 604800, ie one week.

In theory, if we set this field to very large number, then the slave will still respond to query after master is down for looooooong time.

Hope this help.