Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the following DNS zone(bind):

zone "." IN {
    type master;
    file "named.root";
};

If this zone directive cannot resolve the address, how can I "fallback" to another file for the same directive. Ie something like this:

zone "." IN {
    type master;
    file "named.root";
    // fallback file if named.root doesnt resolve
    file "fallback.root";
};
share|improve this question
    
do you have a different set of root servers in your fallback.root file? –  midnightsteel Aug 23 '13 at 21:11
1  
Why do you want to do that? What problem are you trying to solve? –  Michael Kjörling Aug 23 '13 at 21:52
    
@MichaelKjörling In the first named.root I have external root dns servers handling resolution. In the fallback.root, I have local dns servers resolving all of the requests if internet is not available. This way I can do a DNAT to my portal page if no data bearer is available. –  Fostah Aug 24 '13 at 3:22
    
So what you really want to ask is "how can I make my resolving DNS server, currently BIND, resolve all host names to a given address if and only if my Internet connectivity is down?". Correct? (Note that such a question does not presuppose any particular solution, and even leaves open the possibility of using other software to do so.) –  Michael Kjörling Aug 24 '13 at 11:12
add comment

1 Answer

The short answer is: you can't.

When you declare a zone in your BIND configuration, you take responsibility for providing full and accurate data about that zone in the zone file that you name in the file directive of the zone block. That's the major difference especially between hint type zones and other zone types.

You can use some text preprocessor to merge multiple files into a single zone file which you then feed to BIND, but that's something entirely different. You'd also have to take care to make it a legal zone file with legal DNS data (can't have two SOAs for the same RRname, for instance).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.