DNS error: loading from the main file failed:

I am not very good at debugging DNS problems. I am trying to configure two named virtual hosts in apache2 on foo.com and dev.foo.com

I am currently getting a DNS error that I am not sure how to solve it and whether this is related to my apache configuration. However, apache does not complain and does not send an error log on reboot.

dns_master_load: /dev/shm/bind/DO/db.foo.com:14: www.foo.com: CNAME and other data zone foo.com/IN: loading from master file /dev/shm/bind/DO/db.foo.com failed: CNAME and other data zone foo.com/IN: not loaded due to errors. 

My zone file is as follows:

 $TTL 1800 @ IN SOA NS1.nsexample.COM. hostmaster.foo.com. ( 1378763038 ; last update: 2013-09-09 21:43:58 UTC 3600 ; refresh 900 ; retry 1209600 ; expire 1800 ; ttl ) IN NS NS1.nsexample.COM. NS NS2.nsexample.COM. NS NS3.nsexample.COM. @ IN A 123.456.78.910 www IN A 123.456.78.910 www CNAME @ ww CNAME @ dev IN A 123.456.78.910 

Thanks in advance for your help!

+4
source share
2 answers

You cannot have a CNAME and any other record for the same DNS name:

 www IN A 123.456.78.910 www CNAME @ 

In this case, the second line is superfluous, you can delete the CNAME record.

+7
source

You are missing an IN at CNAME, and www CNAME is redundant. It should be:

 @ IN A 123.456.78.910 www IN A 123.456.78.910 ww IN CNAME @ dev IN A 123.456.78.910 

If it affected me, I would change it to:

 @ IN A 123.456.78.910 www IN A 123.456.78.910 ww IN A 123.456.78.910 dev IN A 123.456.78.910 

Use A records wherever possible, keeping the need to create MX and NS records. It also saves on getting any CNAME / A records to which it is attached.

0
source

Source: https://habr.com/ru/post/1501377/


All Articles