Too long for a comment
What am I doing wrong ?
You can validate syntax of zone files with named-checkzone
zone-name
/path/to/zone.file
i.e.
named-checkzone example2.com /etc/named/foo.zone
You can validate the syntax for your named.conf
configuration file with named-checkconf
:
named-checkconf /path/to/named.conf
Note that a valid syntax can still result in logical/functional errors and incorrectly behaving resource records.
@ 3600 SOA example2.com ( ;<=== MISSING FIELD
In the SOA record a field is missing.
The first field is called the MNAME record. The MNAME record must be a name-server that will respond authoritatively for your domain.
The second field is the RNAME record, the
email address of the administrator responsible for this zone. (As usual, the email address is encoded as a name. The part of the email address before the @ becomes the first label of the name; the domain name after the @ becomes the rest of the name. In zone-file format, dots in labels are escaped with backslashes; thus the email address [email protected]
would be represented in a zone file as john\.doe.example.com.
)
Be careful with zone file shorthand
86400 NS example2.com. ; STARTING A LINE WITH A BLANK IS VALID SHORTHAND
@ IN 86400 NS example2.com. ; This is less likely to misbehave
It might be an artefact of how you formatted your question, but the formatting of zone files has meaning (starting a line with a blank name for example makes the line a continuation of the previous resource record name) and having mail
aligned with 14400
is wrong.
14400 A 1.2.3.4
mail 14400 A 1.2.3.4 ; this alignment is incorrect
mail 14400 A 1.2.3.4 ; there should be no space/tab before mail