LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   BIND - SOA record not at top of zone (https://www.linuxquestions.org/questions/linux-networking-3/bind-soa-record-not-at-top-of-zone-248640/)

granny 10-29-2004 12:29 AM

BIND - SOA record not at top of zone
 
My BIND is working, well for the most part. But I tried to use an $INCLUDE statement in my zone file, and I get an error.

I have a zone, example.com, that works perfectly fine. Zone file is example.com.zone

At the bottom of the zone file, I place the line

$INCLUDE /var/named/chroot/sales.example.com.zone sales.example.com.
(I have tried many variations of the above, still with no luck)

I have created a zone file named /var/named/chroot/sales.example.com.zone

When I use the $INCLUDE line in example.com.zone and do a named-checkzone example.com example.com.zone, I get this error

dns_master_load: /var/named/chroot/sales.example1.com:2: SOA record not at top of zone (sales.example.com)

zone example.com:/IN: loading master file example.com: not at top of zone

If I comment out the $INCLUDE line and do a named-checkzone on each, they come up with no errors.

Where am I going wrong?

Oh, and the SOA record for both zones is at the top! That's why I don't know what to do about this error.

scowles 10-29-2004 09:18 AM

I haven't reviewd all the latest tip/tricks for bind lately, but I don't think you can include a delegated zone (sub-domain) from within the tld zone.

The proper way (according to the DNS/BIND book) to create a subdomain is...

1) Add the delegation/glue records for the subdomain to the TLD zone.
Code:

# cat db.mydomain
; ------------------------------------------------------------
; sales.mydomain.com delegated zone (Glue Records)
; ------------------------------------------------------------
sales  1d      IN      NS      ns1.sales.mydomain.com.

2) Add the subdomain entry to named.conf
Code:

# cat named.conf
    // Load the mydomain.com zone
    zone "mydomain.com" in {
            type master;                    // Zone is a master
            notify no;                      // Send notifies?
            file "int/db.mydomain";        // Load zone file
    };
 
    // Load the sub-domain sales.mydomain.com zone
    zone "sales.mydomain.com" in {
            type master;                    // Zone is a master
            notify no;                      // Send notifies?
            file "int/db.sales";            // Load zone file
    };


ugge 10-29-2004 09:27 AM

There can only be one SOA in a zone file.
The SOA record is used to tell where my Authority begins in the DNS Name Space.
If I have authority to the domain.com then I also have authorities to all possible subdomains of that.
I can however delegate authority of a subdomain to someone else.

ugge 10-29-2004 09:28 AM

Explanation my latest post: The zone and domain isnät the same thing.


All times are GMT -5. The time now is 10:17 AM.