Error in named-checkzone: DNS zone error: has no address records (A or AAAA)

I am configuring my private DNS server. I am following this tutorial. But when I reached the Check BIND Configuration Syntax step, I got some errors.

Here is the command output:

x@e-dns1:/etc/bind$ sudo named-checkzone xyz1.com forward.xyz1.com
zone NS 'dns1.xyz1.com.xyz1.com' has no address records (A or AAAA)
zone NS 'dns2.xyz1.com.xyz1.com' has no address records (A or AAAA)
zone not loaded due to errors.

The file: forward.xyz1.com contains the following:

$TTL 604800
@ IN SOA dns1.xyz1.com. admin.xyz1.com. ( 3 ; Serial 604820 ; Refresh 86600 ; Retry 2419600 ; Expire 604600 ) ; Negative Cache TTL
; name servers - NS records IN NS dns1.xyz1.com IN NS dns2.xyz1.com
; name servers - A records
dns1.xyz1.com. IN A 192.168.56.3
dns2.xyz1.com. IN A 192.168.56.5
; 192.168.56.0/24 - A records
host1.xyz1.com. IN A 192.168.56.6
host2.xyz1.com. IN A 192.168.56.8

Can you please point the me what is wrong? I want to dns servers to be:

dns1.xyz1.com
dns2.xyz1.com

and the hosts:

host1.xyz1.com
host2.xyz1.com
1

1 Answer

In a bind9 zone file, any fully qualified domain name (FQDN) needs to have the ending . character added to it.

Your references around line 11-12ish

; name servers - NS records IN NS dns1.xyz1.com IN NS dns2.xyz1.com

Don't have them.

Should be:

; name servers - NS records IN NS dns1.xyz1.com. IN NS dns2.xyz1.com.

Don't forget to increase your serial.

Also, don't forget that if you are doign this for real you need to have glue records set up otherwise one of your name servers must be outside of your domain (zone).

8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like