5

I'm trying to learn dns and bind on centos 7 at digital ocean. When I run named-checkzone I get the same errors. When I change around the white space I stop that error only to replace it with a 0 SOA and no NS error.

sudo named-checkzone example.com /etc/named/zones/example.com.zone
/etc/named/zones/example.com.zone:1: no current owner name
/etc/named/zones/example.com.zone:2: no current owner name
/etc/named/zones/example.com.zone:3: no current owner name
/etc/named/zones/example.com.zone:16: no current owner name
/etc/named/zones/example.com.zone:17: no current owner name
/etc/named/zones/example.com.zone:18: no current owner name
/etc/named/zones/example.com.zone:19: no current owner name
/etc/named/zones/example.com.zone:24: no current owner name
/etc/named/zones/example.com.zone:25: no current owner name
/etc/named/zones/example.com.zone:26: no current owner name
/etc/named/zones/example.com.zone:27: no current owner name
/etc/named/zones/example.com.zone:28: no current owner name
/etc/named/zones/example.com.zone:29: no current owner name  

$ORIGIN example.com.
$TTL 14400
@    IN    SOA    ns1.example.com.    hostmaster.example.com. (
2014071301 ; serial.  date.    today + increment
3600       ; refresh. seconds. frequency slave refreshes from master.
600        ; retry.   seconds. frequency slave retries master after failure.
604800     ; expire.  seconds. slave stops responding as authoritative.
86400      ; ttl.     seconds. Maximum caching time by resolver.
)

;------------------------------------------------------------------------------
; Special Records
;
; Note: SPF Records are limited to 10 DNS lookups recursively.
;
IN NS    ns1.example.com.
IN NS    ns2.example.com.
IN MX    10   mail.example.com.
IN TXT  "v=spf1 -ALL"

;------------------------------------------------------------------------------
; Main Records
;
@           IN A    192.0.2.1
*           IN A    192.0.2.1
ns1         IN A    192.0.2.2
ns2         IN A    192.0.2.3
mail        IN A    192.0.2.1
www         IN A   192.0.2.1

Same thing with the reverse called db.192.0

$ORIGIN  2.0.192.in-addr.arpa.
$TTL 86400

@      IN      SOA     ns1.example.com.        hostmaster.example.com. (
3 ; serial
21600      ; refresh after 6 hours
3600       ; retry after 1 hour
604800     ; expire after 1 week
86400 )    ; minimum TTL of 1 day

@  IN  NS     ns1.example.com.
2             IN      PTR     ns1.example.com.
3             IN      PTR     ns2.example.com.
5
  • Please remove the white space at the beginning of the lines. Aug 20, 2016 at 5:27
  • Julie, thank you. I've tried that, back and forth with the white space. I'll try again but it gives the error 0 SOA and no NS records when I remove the space. When I put it back it gives the no name error. I'm in an infinite loop. :-) Aug 20, 2016 at 5:29
  • Don't remove all the white space, just the single spaces at the beginning of the lines. Aug 20, 2016 at 5:31
  • I did have it flush left and got that error about 0 SOA and no NS. I'll try again tomorrow. This has been frustrating but I've done certain things over enough that it really has Aug 20, 2016 at 6:32
  • been a good DNS learning experience. Setting up Bind build character now I need to get it working so I can break it. :-) Aug 20, 2016 at 6:40

1 Answer 1

5

As Julie Pelletier already commented, remove the leading white spaces in your zone records, as they hold a special meaning in Bind zone files.

By starting a line with a white space (which is neither a hostname, the zone name or the @ shorthand for the zone origin) that line becomes a continuation of the record above it.

$ORIGIN neilanuskiewicz.com.
$TTL 14400
 @    IN    SOA    ns1.neilanuskiewicz.com.   ...

That makes the line with the SOA record a continuation of the none existent record above it (the variables don't count in that regard) and hence your failure; there is resource record above it, no owner to apply that continuation record to.

$ORIGIN neilanuskiewicz.com.
$TTL 14400
@    IN    SOA    ns1.neilanuskiewicz.com.   ...

You can intentionally use lines starting with a white space to though:

@                    IN  A     192.0.2.1       ; IPv4 address for the bare domain using the @ short hand
neilanuskiewicz.com. IN  AAAA  2001:db8:10::1  ; IPv6 address for the bare domain
www                  IN  A     192.0.2.1            
                     IN  AAAA  2001:db8:10::1  ; IPv6 address for www using DNS shorthand by starting this line with a space

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.