Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

on my intranet dns server, want to override some addresses.

So basicially, it should forward all resolving requests for the zone mydomain.tld, that are not in the "/etc/named/mydoamin.tld" file to the real DNS servers...

zone "mydomain.tld" IN {
    type master;
    file "/etc/named/mydomain.tld";
    forwarders { 1.1.1.1; 2.2.2.2; 3.3.3.3; };
    forward only;
};

how can this be done?


Clarification:

In the file "/etc/named/mydomain.tld" there are - for example - a cupple of records:

abc.mydomain.tld.      IN    A 192.168.1.2
def.mydomain.tld.      IN    A 192.168.1.3
ghi.mydomain.tld.      IN    A 192.168.1.4
jkl.mydomain.tld.      IN    A 192.168.1.5

and - for example - this records are (not in the file "/etc/named/mydomain.tld" but) in the offical nameservers:

abc.mydomain.tld.      IN    A 123.123.123.123
www.mydomain.tld.      IN    A 123.123.123.123
mail.mydomain.tld.     IN    A 123.123.123.123

so when a client in the intranet asks the intranet nameserver, the namesever should first look at his definitions and then in the case the entry is NOT sepcified, he should ask the official nameservers.

if the client asks for abc.mydomain.tld. the intranet nameserver should return 192.168.1.2...

and if the client asks for www.mydomain.tld. the intranet nameserver should return 123.123.123.123...

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You cannot do this. Each DNS server must either contain a complete copy of the DNS zone, or have the entire DNS zone forwarded to the other server. You cannot have bits and pieces on different servers (unless you create sub-zones and delegate using NS records, but I digress).

So either make your internet and intranet servers the same, or forward one to the other like so:

zone "mydomain.tld" IN {
    type forward;
    forwarders { your-other-server-here; };
};
share|improve this answer
    
i do not want to use forwarders for all domains. just for the mydomain.tld in case the requested name is not in the file. –  JMW Nov 9 '11 at 11:28
    
it's not a valid answer, but thanks for answering :-) –  JMW Nov 9 '11 at 14:09
    
In which case your original question was not clear enough. I notice you have further clarified your question -- the answer is simple: you can't. I will edit my answer. –  Jeremy Visser Nov 12 '11 at 15:05
    
added the clarification –  JMW Nov 29 '11 at 11:16
    
I’ve updated the answer. Thanks, your question is much clearer now. :-) –  Jeremy Visser Dec 2 '11 at 1:33
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.