DNS modification errors: Error writing the db file: Unable to save dns zone: named-checkzone returned

darkus

Verified User
Joined
Dec 15, 2005
Messages
121
I recently changed the name of my domain, which looks to have gone very smoothly, however there is one problem with updating my DNS records, which I *think* might be related to the change in the domain name, but im not sure.

The problem i'm having is occurring when i try to enable/disable DKIM (which is working fine with other domains on the same server).

The error is:

Error writing the db file: Unable to save dns zone: named-checkzone returned:
loading "xxxx.com" from "/var/named/xxxx.db.temp.40781.uQs9gCUl1B" class "IN"
zone xxxx.com/IN: NS 'ns1.xxxx.com' has no address records (A or AAAA)
zone xxxx.com/IN: NS 'ns2.xxxx.com' has no address records (A or AAAA)
zone xxxx.com/IN: not loaded due to errors.

$TTL 3600
@ IN SOA ns1.xxxx.com. hostmaster.xxxx.com. (
2025050803
3600
3600
1209600
86400 )

xxxxcom. 14400 IN NS ns1.xxxx.com.
xxxx.com. 14400 IN NS ns2.xxxx.com.

ftp 14400 IN A 1.2.3.4
xxxx.com. 14400 IN A 1.2.3.4
mail 14400 IN A 1.2.3.4
pop 14400 IN A 1.2.3.4
smtp 14400 IN A 1.2.3.4
www 14400 IN A 1.2.3.4
www5 3600 IN A 1.2.3.4

xxxx.com. 14400 IN MX 10 mail.xxxx.com.



xxxx.com. 14400 IN TXT "v=spf1 a mx ip4:1.2.3.4 ~all"
x._domainkey 3600 IN TXT ( "v=DKIM1; k=rsa; p=...."
"...."
"...." )


As I say, Im not sure if this is an error on its own, or somehow related to my domainname change

In case its related to my domain name change, the way I went about it is:
1. I used to have domain yyyy.com with a domain pointer from xxxx.com to yyyy.com
2. I deleted the xxxx.com pointer, so that there would be no record of it left (so i hoped)
3. I then renamed yyyy.com to xxxx.com as the main base domain

All that seems to have worked except this dns issue. After doing some googling one suggestion was about wrap_long_dns_values=1 which is set to 1 on my server already

ANy ideas/assistance?
 
ANy ideas/assistance?
Yes, the cause is mentioned in the error.

zone xxxx.com/IN: NS 'ns1.xxxx.com' has no address records (A or AAAA)
zone xxxx.com/IN: NS 'ns2.xxxx.com' has no address records (A or AAAA)
So xxx.com has nameservers ns1.xxx.com and ns2.xxx.com and is missing A records for it.

If you use ns1 and ns2.xxx.com dan xxx.com needs A and NS records for both nameservers.
 
Yes, the cause is mentioned in the error.


So xxx.com has nameservers ns1.xxx.com and ns2.xxx.com and is missing A records for it.

If you use ns1 and ns2.xxx.com dan xxx.com needs A and NS records for both nameservers.
Thanks for the tip, as you can tell im an idiot newbie at DNS

So if im understanding correctly, I tried to add an A record named ns1.xxxx.com with a value pointing back to the server IP address 1.2.3.4

This still presents an error, but slightly different I guess because it is now taking ns1 record (but not ns2) --- thers no way to add 2 records simultanously:


Unable to save dns zone: named-checkzone returned:
loading "xxxx.com" from "/var/named/xxxx.com.db.temp.48160.IPj2MwiKLn" class "IN"
zone xxxx.com/IN: NS 'ns2.xxxx.com' has no address records (A or AAAA)
zone xxxx.com/IN: not loaded due to errors.
 
Yes, the cause is mentioned in the error.


So xxx.com has nameservers ns1.xxx.com and ns2.xxx.com and is missing A records for it.

If you use ns1 and ns2.xxx.com dan xxx.com needs A and NS records for both nameservers.
Ok follow-up with GREAT SUCCESS. Thanks much for the direction with this

For anyone else having this problem in the future, since i cant edit two entries at the same time in DA control panel, i went in and just edit the file listed in the error: /var/named/xxxxx.com.db and directly insert the two ns1/2 entries and now everything is working great
 
For anyone else having this problem in the future, since i cant edit two entries at the same time in DA control panel, i went in and just edit the file listed in the error: /var/named/xxxxx.com.db and directly insert the two ns1/2 entries and now everything is working great
WRONG!
You can edit the database manually and it will work as far as DA is concerned, but for this to work around the world the SOA serial needs to be updated. So update SOA serial via a commandline command, or edit and remove something else in the DNS Gui to get the serial updated.

Since i cant edit two entries at the same time in DA control panel
That's the downside of the Evo skin when editting things. So the correct way to do this is not to edit the /var/named/xxx.db files but the correct way is to create new A and NS records and then remove the old ones.

Or just remove them all together (which is possible) and then create new ones.
 
WRONG!
You can edit the database manually and it will work as far as DA is concerned, but for this to work around the world the SOA serial needs to be updated. So update SOA serial via a commandline command, or edit and remove something else in the DNS Gui to get the serial updated.


That's the downside of the Evo skin when editting things. So the correct way to do this is not to edit the /var/named/xxx.db files but the correct way is to create new A and NS records and then remove the old ones.

Or just remove them all together (which is possible) and then create new ones.
So since ive done it the wrong way, is your advice right now to try to remove all of it from the control panel and try to re-add the NS back in?
 
now to try to remove all of it
No. Since it's working locally you just need to update your soa serial of that domain.
The most easy way to update your soa serial now (for you) is to just add some random A record like example, wait until it's saved, and then remove it again. This action will update the soa serial for you.
 
No. Since it's working locally you just need to update your soa serial of that domain.
The most easy way to update your soa serial now (for you) is to just add some random A record like example, wait until it's saved, and then remove it again. This action will update the soa serial for you.
Much appreciated
 
You're welcome.

I just wrote "wrong" fat so not everybody reading it would copy your method instantly without thinking.

One has to know what one is doing and needs to be aware of the fact that if a manual change is done the serial also needs to be updated for things to be correct.
After a manual change in de a /var/named/xxx.db file (not advised) this can be best done with this command:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
or just like above, add and remove some random record in DNS manager.
 
You're welcome.

I just wrote "wrong" fat so not everybody reading it would copy your method instantly without thinking.

One has to know what one is doing and needs to be aware of the fact that if a manual change is done the serial also needs to be updated for things to be correct.
After a manual change in de a /var/named/xxx.db file (not advised) this can be best done with this command:
echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue
or just like above, add and remove some random record in DNS manager.
No question it is an important warning for those coming later, and hopefulyl this thread helps someone in the future as it has me
 
Back
Top