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.

Is it possible to configure named.conf to have a default behavior?

For instance, if this is my named.conf ( https://gist.github.com/3c755018696e262ee4d9 ) & this is guubo.com.db ( https://gist.github.com/affa63b5a5b250b5de17 )

Basically there are many domains pointing to ns1.hotelpublisher.com ns2, .. and they all have the same configuration as guubo.com.db (except for the domain name, of course). But Google settings, server support email, etc. is same on every domain.

share|improve this question
    
Why don't you just write script for auto-generation of default configs? –  rvs May 25 '11 at 8:10
    
Yes, this is the thing I am working on at the moment. Though, I find it kinda redundant if the same thing is possible without all that mess. –  Guy May 25 '11 at 8:15
add comment

1 Answer 1

Well, what I did was: I've created default.db file which I've included with every master zone. named.conf therefore looks like this:

# [..]
zone "hotelpublisher.com"
{
    type master;
    file "/var/named/default.db";
};

zone "guubo.com"
{
    type master;
    file "/var/named/default.db";
};

And default.db like this:

$ttl 14400
@ IN SOA ns1.hotelpublisher.com. server@hotelpublisher.com. (
 2011041105; Serial in YYYYMMDDXX (XX is increment)
 10800; refresh seconds
 3600; retry
 604800; expire
 38400; minimum
);

@ IN A 77.79.10.25
@ IN NS ns1.hotelpublisher.com.
@ IN NS ns2.hotelpublisher.com.

@ IN MX 1 aspmx.l.google.com.
@ IN MX 5 alt1.aspmx.l.google.com.
@ IN MX 5 alt2.aspml.l.google.com.
@ IN MX 10 aspmx2.googlemail.com.
@ IN MX 10 aspmx3.googlemail.com.

www IN CNAME @
mail IN CNAME ghs.google.com.

@ TXT "v=spf1 a mx ptr mx:aspmx.googlemail.com include:aspmx.googlemail.com ~all"

This removed a lot of redundancy. If any comments, feel free to share.

share|improve this answer
    
Use in-bailiwick intermediate names for your content DNS servers. i.e. use ns1 (not fully qualified, note) rather than the fully qualified ns1.hotelpublisher.com.. And add ns1 IN A 77.79.10.25 and ns2 IN A 77.79.13.238 of course. –  JdeBP May 25 '11 at 11:19
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.