2

I'm sure I'm doing a stupid here ... but I've stared at it too many hours. Can someone see what's wrong with this zone file for bind9 on a Fedora-family server? (actually its the AWS distro, but that appears to be Fedora-based)

The error messages are:

dns_master_load: /etc/named/zones/MyDomain.com:2: unexpected end of line
dns_master_load: /etc/named/zones/MyDomain.com:1: unexpected end of input
/etc/named/zones/MyDomain.com:10: using RFC1035 TTL semantics
zone MyDomain.com/IN: loading from master file /etc/named/zones/MyDomain.com failed: unexpected end of input
zone MyDomain.com/IN: not loaded due to errors.
_default/MyDomain.com/IN: unexpected end of input

And the zone file is:

@ttl 38400
MyDomain.com.        IN      SOA     MyDomain.com. daniel\.wilson.MyDomain.com. (
                              3         ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800    ; Negative Cache TTL
                38400 )
; NS
MyDomain.com.        IN      NS      oh.MyDomain.com.
MyDomain.com.        IN      NS      or.MyDomain.com.
; A
oh.MyDomain.com.     IN      A       13.58.189.20
or.MyDomain.com.     IN      A       54.190.193.149
MyDomain.com.        IN      A       13.58.189.20
; CNAME
www             cname MyDomain.com.
ftp             cname MyDomain.com.
wayne           cname MyDomain.com.
ybdev1          cname MyDomain.com.
; MX
MyDomain.com.        IN      MX      1 ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      5 ALT1.ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      5 ALT2.ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      10 ASPMX2.GOOGLEMAIL.COM.
MyDomain.com.        IN      MX      10 ASPMX3.GOOGLEMAIL.COM.

Thanks!

Daniel Wilson
  • 123
  • 1
  • 1
  • 3

2 Answers2

2

On line 1, you've typed "@ttl 38400". Instead of using the '@' character, you should use the '$' character. The line should read, "$ttl 38400".

The '@' character is a reference to the domain. For example, it would be valid to type:

@        IN      NS      oh.MyDomain.com.

instead of

MyDomain.com.        IN      NS      oh.MyDomain.com.
ADS103
  • 116
  • 1
  • 6
  • 1
    A minor pedantic remark: the `@` is shorthand in zone files and will get substituted with the value of `$ORIGIN`. The default/implied value of `$ORIGIN` is indeed the name of the zone (domain), but you can also set it to something else such as a [single dot](https://serverfault.com/q/879913/37681) or even [changed multiple times](https://serverfault.com/a/819242/37681) – HBruijn Oct 26 '17 at 14:45
1

Change @ttl to $TTL. Also make sure there no issues with encoding (for instance strage white spaces).

Also I suggest to:

  • Start using @ and relative domains
  • Change serial to YYYYMMDDNN format