API: no_such_zone


#1

Ignoring my past thread (from a few months ago) as I fear simply bumping it would not return any help plus the fact that despite my late email, the ‘code monkey’ fellow did not respond and it appears I cannot PM him:

I’ve created my own script that works around submitting the standard URL to add/remove DNS records.

For example:

That’s the standard URL that worked once for me. However it only produces the following error now :

error no_such_zone
Any idea why?


#2

Have you checked that the record is editable ?


#3

It most definitely is. Removing records is possible but adding records (through the API) is not possible.


#4

You can remove the A record for a zone but not replace it ?


#5

Afraid so. Initially adding the new record and then deleting the old record worked but that eventually stopped.


#6

But you can still remove records? Can you remove all records and have no zone records at all?


#7

Yes. There is nothing stopping me from having zero DNS records.


#8

Surely you jest.


#9

Well I don’t see how it’s impossible. Without any DNS records the site will just appear offline.


#10

I’m not insinuating that it’s impossible, I’m just struggling to believe that the API will allow all records to be deleted but doesn’t provide a method to add any to the zone. If that’s the case then it’s beyond broken.


#11

The DNS commands are one of the older and grodier bits of the customer API. So it’s definitely not perfect, and based on the code I’m looking at:

[code]# check for redundancy/conflicts/permission.
my $found_zone = 0;
foreach my $Account ($Person->OwnedAccounts, $Person->AccessibleAccounts) {
foreach my $R ($Account->DNSRecords($Person)) {
next if $R->zone eq ‘default’; # who cares about NS records?
if ($R->zone eq $zone) {
$found_zone = 1;
if ($record eq $R->name.($R->name ? ‘.’ : ‘’).$R->zone.’’) {
return {‘result’=>“error”,‘data’=>“CNAME_must_be_only_record”} if $type eq ‘CNAME’;
return {‘result’=>“error”,‘data’=>“CNAME_already_on_record”} if $R->type eq ‘CNAME’;
if ($type eq $R->type) {
if ($value eq $R->value) {
if ($R->class eq ‘dh’) {
return {‘result’=>“error”,‘data’=>“record_already_exists_not_editable”};
} else {
return {‘result’=>“error”,‘data’=>“record_already_exists_remove_first”};
}
}
}
}
}
}
}

return {‘result’=>“error”,‘data’=>“no_such_zone”} unless $found_zone;[/code]

… it’s pretty clear what the issue is. I don’t have the time to fix it right now, as I’m currently working on a different project, but I’ll try and get to it soon.

That being said, I also see a really simple workaround. Create some other DNS record (any name, any type) on the domain you’re working with. So long as there is always at least one other DNS record there, you won’t get the “no_such_zone” error.


#12

When you get time to fix it for them, could you sneak in some nameserver goodness? :slight_smile:

EDIT:

scratch that, just refreshed dns-list_records and saw that it added NS no probs :smiley:


#13

sXi: Possibly! What are you after?


#14

Oh, I had added a nameserver as a test and it didn’t appear immediately, but after I posted above I went back and refreshed the list and discovered that it was added correctly. Think I just refreshed too quickly the first time and beat it by a millisecond.


#15

That’s good news. I look forward to there being a fix in the future. I guess I’ll try adding an A record of 0.0.0.0 in the meantime.


#16

A simple (non-volatile) TXT record should suffice.


#17

Thanks. I’ll try that.