-
Hey Guys After I created a domain and some records. When I now try to delete the records, I get a message No SOA found for domain 'testmydomain.co.za.' What might be causing this as there is an soa record for the domain in the database? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Can you give an example of your code? Without it, it is difficult for us to tell if there's a bug or something. |
Beta Was this translation helpful? Give feedback.
-
I think it may be something in the way I am calling the api... How should I call the api? $powerdns = new Powerdns($user->Server->hostname, $user->Server->api_key); So this for example is to delete the A record (the primary A record for the domain) |
Beta Was this translation helpful? Give feedback.
-
Deleting the sub records though have no issue, so I suspect it's only the @ records that I may be handling incorrectly? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your example. It seems there's a bug in the Having said that, you're using a So this problem has two sides:
In my test script, this is working as expected: $powerdns = new Powerdns($user->Server->hostname, $user->Server->api_key);
// use the full canonical name ending with a dot |
// V
$powerdns->zone('test2.co.za')->find('test2.co.za.', RecordType::A)->delete(); We're going to fix this in an upcoming release, but until then you can use the example above as a workaround. |
Beta Was this translation helpful? Give feedback.
Thanks for your example. It seems there's a bug in the
find
method: strictly speaking, you always need canonical zone names (ending with a dot;test2.co.za.
). To keep things simple, the package will handle this for you. In this case, a sub record will be 'transformed' towww.test2.co.za.
whiletest2.co.za
should be transformed totest2.co.za.
, however, this doesn't happen.Having said that, you're using a
find
without setting a record type, so it returns all records matching the name. In this case, also the SOA and NS records are being returned by PowerDNS (and in a real-world scenario probably also the MX records). Calling thedelete
method, will also delete those records which could exp…