0

I have a lot of domains

abc.example
def.example
ghi.example
jkl.example

Each of them are pointed to nameservers on their own domain

abc.example -> ns1.abc.example
               ns2.abc.example

def.example -> ns1.def.example
               ns2.def.example

ghi.example -> ns1.ghi.example
               ns2.ghi.example

jkl.example -> ns1.jkl.example
               ns2.jkl.example

These nameservers all resolve to the same IP where I am running a BIND server. I want this BIND server to act as a catch-all and respond with an A record to the same IP.

*    A     192.0.2.4

What I don't understand how to setup are the SOA and NS records. What would the zone file look like in order to achieve this?

  • All A records in all zones will point to the BIND server ip address? – ALex_hha Sep 24 '13 at 7:42
  • @ALex_hha Yep, exactly! Is there a better way to do this? – Axsuul Sep 24 '13 at 18:34
1

Create a reference zone file which is shared by all zones. The content of that zone file uses @ symbol so no real zones name are referenced. The only trick is to use short names for the records (not FQDN names with trailing dots).

Reference zone file example:

$TTL 38400
@      IN      SOA     ns1 hostmaster (
                       2013102301
                       10800
                       3600
                       604800
                       38400 )

       IN       NS     ns1
       IN       NS     ns2

ns1  IN       A      192.0.2.37
ns2  IN       A      192.0.2.59

*    IN       A      192.0.2.4

Then, configure zones to use this zone file:

zone "abc.example" {
    type master;
    file "reference-zone.db";
};

zone "def.example" {
   type master;
   file "reference-zone.db";
};

Finally, you can use the same procedure for reverse zones.

| improve this answer | |
  • Is there any way to make that reference zone file applicable to any domain so that I don't have to configure each zone to use the zone file? In other words, how can I make that reference zone file apply to any domain? Thanks for taking the time to answer! – Axsuul Sep 24 '13 at 18:33
  • IMO, this is not possible with BIND. But it's not so complicated to prepare a simple template system to generate them. – dsmsk80 Sep 24 '13 at 18:41
  • Thanks, do you know of any other software that can achieve this? – Axsuul Sep 24 '13 at 22:53
  • Solved this using TinyDNS – Axsuul Sep 25 '13 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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