DNS records disappeared

Lukemob

Verified User
Joined
Feb 1, 2011
Messages
11
Hello,

I'm experiencing such a problem. Whenever I open a domain DNS management, I see empty table (but it should be existing - the records and everything are set correctly and bind logs without problem.)

When I tried to add an A record, I get following message:
Code:
Error Writing Records

Details

Unable to save dns zone: named-zonecheck returned:
loading "domain.eu" from "/etc/bind/domain.eu.db.temp" class "IN"
dns_rdata_fromtext: /etc/bind/domain.eu.db.temp:15: near eol: unexpected end of input
zone domain.eu/IN: loading from master file /etc/bind/domain.eu.db.temp failed: unexpected end of input
zone domain.eu/IN: not loaded due to errors.

I think that it could be some permission problem. But why does DA use: domain.tld.db.TEMP? .TEMP file doesn't even exist on server.

Thank you for ideas.
 
I think that it could be some permission problem. But why does DA use: domain.tld.db.TEMP? .TEMP file doesn't even exist on server.
It did exist at some point; line 15 of the file is where the unexpected end of input occurred.

Jeff
 
Hello,

thank you guys for reply.

Jeff: is there anything we can do about named-zonecheck? If it used the original files, it would work perfectly. How could happen named-zonecheck to use those .temp files?

Thanks.
 
Maybe DA has no access to bind files and creates .temp to keep everything functional? Strange if yes, because I can't find any .temp files in that directory.
 
named-checkzone domain.eu /etc/bind/domain.eu.db

returns:

Code:
/etc/bind/domain.eu.db:7: no TTL specified; using SOA MINTTL instead
zone domain.eu.db/IN: loaded serial 2012020911
OK

Does DirectAdmin require special format?
 
Are you running Debian server there? And what permissions do you have on /etc/bind/? I've got these:

Code:
da:~# ls -ld /etc/bind/
drwxr-sr-x 2 root bind 4096 2011-11-28 11:06 /etc/bind/

If they differ by your side, you might want to try from my example and check the things with directadmin.
 
To see exactly what's being restored, it will likely be simplest to disable the check:
http://www.directadmin.com/features.php?id=1167
Code:
named_checkzone=0
and then do whatever was done to the db file to generate the error.
Check the db file after it's done and see what it looks like.

When the check is enabled, DA writes the db to the temp file first, checks it with the named-checkzone command.. and if it passes (only if it passes), will the temp be renamed to the db file.
If it fails, an error is generated and the temp file removed.

Another way to go about debugging it, with the check enabled, is to run DA in debug mode:
http://help.directadmin.com/item.php?id=293

debug Level 20 should be sufficient for the check's errors.
For that case, the debug will output the actual zone, making it easier to see what's up.



One guess, as to the cause, would be to check:
Code:
cd /usr/local/directadmin/data/templates
cat named.db
cat custom/named.db
which should look like this:
Code:
|?NS_TIME=14400|
|?A_TIME=14400|
|?MX_TIME=14400|
|?CNAME_TIME=14400|
|?PTR_TIME=14400|
|?TXT_TIME=14400|
|?AAAA_TIME=14400|
|?SRV_TIME=14400|
$TTL 14400
@       IN      SOA     |NS1|      |EMAIL| (
                                                |SERIAL|
                                                14400
                                                3600
                                                1209600
                                                86400 )

|NS|
|A|
|MX|
|CNAME|
|PTR|
|TXT|
|AAAA|
|SRV|
Note, if you have custom/named.db, then it will override the default named.db.

John
 
Hello,

Thank you for your replies.

It looks like I successfully found out why it does such things. In named.db file (no custom exists) it looks like the one posted. But in my domain.com.db file, there's a little bit of difference:

named.db
Code:
[B]@[/B]       IN      SOA     |NS1|      |EMAIL| (

domain.com.db
Code:
[B]domain.com.[/B]       IN      SOA     |NS1|      |EMAIL| (


Does it have to be @ instead of domain name? Should I rewrite it? Or is there any way to skip the check of the first value?

Thank you!
 
Does it have to be @ instead of domain name? Should I rewrite it? Or is there any way to skip the check of the first value?
Maybe, maybe not, depending on how your zone files are called and where the @ sign is used.

If used in the top record in the file (above any meta setting for $ORIGIN but above or below any other meta settings), the @ sign refers to the scope of the zone as defined in the named.conf file.

So if your zone file is defined in your named.conf file as example.com then the @ sign used in the first record refers to example.com. (with the dot at the end).

When used lower down in the zone file, the @ sign refers either to the domain name as defined by the most recent preceding $ORIGIN setting in the file, or lacking one, the same as above.

See: http://en.wikipedia.org/wiki/Zone_file

Jeff
 
Back
Top