Delete RRset with curl

Hello,

can someone please give me an example how to delete a RRset. I got allways the response

“The requested resource was not found on this server”

This boths entries i try to delete

{
“created”: “2020-04-28T08:01:58.630984Z”,
“domain”: “example.dedyn.io”,
“subname”: “”,
“name”: “example.dedyn.io.”,
“records”: [
“1.2.3.4”
],
“ttl”: 60,
“type”: “A”
}

{
	"created": "2020-04-28T06:22:13.679219Z",
	"domain": "example.dedyn.io",
	"subname": "",
	"name": "example.dedyn.io.",
	"records": [
		"\"example_test\""
	],
	"ttl": 3600,
	"type": "TXT"
},

Regards, Henry

Hi Henry,

RRset deletion is documented here and refers to the RRset endpoint, which you can see in use e.g. here.

What status code do you receive along with “The requested resource was not found on this server”? When you delete something, our API should return status code 204 No Content.

If you observe behavior that is different from the documented one, please shoot us an email to support at desec.io with your exact command input and output (you can of course mask your token).

Stay secure,
Peter

Hi,

i need a working example to understood how it works.

What i have tried:

curl -X POST https://desec.io/api/v1/domains/example.dedyn.io/rrsets/
–header “Authorization: Token XXXXXXXXXXXXXXXXXX”
–header “Content-Type: application/json”
–data ‘{“subname”: “_mytest”, “type”: “TXT”, “ttl”: 3600, “records”: ["“frist try”"]}’

{
“created”: “2020-04-28T09:16:34.572642Z”,
“domain”: “example.dedyn.io”,
“subname”: “_mytest”,
“name”: “_mytest.example.dedyn.io.”,
“records”: [
““frist try””
],
“ttl”: 3600,
“type”: “TXT”
}

curl -X POST https://desec.io/api/v1/domains/example.dedyn.io/rrsets/
–header “Authorization: Token XXXXXXXXXXXXXXXXXX”
–header “Content-Type: application/json”
–data ‘{“subname”: “_mytest”, “type”: “TXT”, “ttl”: 3600, “records”: []}’

{“records”:[“This field must not be empty when using POST.”]}

curl -X DELETE https://desec.io/api/v1/domains/example.dedyn.io/rrsets/_mytest/
–header “Authorization: Token XXXXXXXXXXXXXXXXXX”

<!doctype html>

Not Found

Not Found

The requested resource was not found on this server.

After the subdomain part _mytest/, you also need to specify the record type, i.e. the final part of the URL should be rrsets/_mytest/TXT/. Does that solve the problem?

Stay secure,
Peter

PS: Please use preformatted format for terminal outputs to make your posts easier to digest. :slight_smile:

This example should work if you use PUT instead of POST. Also with PUT, you can send an array of RRSets so you can delete more than one RRset at once.

@mihi, you can also use PATCH, which works like PUT except that you can leave out the ttl (which is meaningless anyway for a deletion operation).

Hi,

thanks for all the asnwers.

curl -X DELETE https://desec.io/api/v1/domains/example.dedyn.io/rrsets/_mytest/TXT/ --header “Authorization: Token XXXXXXXXXXXXXXXXXX”

this works for me. :slight_smile:

One problem was that i have first created a TXT entry without a subname.

But now everthings is fine. :slight_smile: