Report this

What is the reason for this report?

What is the proper way to request "List All Domain Records" from the API?

Posted on November 9, 2015

I’m using the following code (with my respective API key and domain) to make a request to get all domain records. The problem is that I don’t get back my domain records, instead, I get the Digital Ocean domain records. I have made other requests using my domain and API key and got back correct information. What part of this request is causing me to not get back my domain records?

This is my request:

curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer MY_API_KEY' "https://api.digitalocean.com/v2/domains/MYDOMAIN.com/records" 

This is my output:

{
    "domain_records": [
        {
            "id": 9663214,
            "type": "NS",
            "name": "@",
            "data": "ns1.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663215,
            "type": "NS",
            "name": "@",
            "data": "ns2.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663216,
            "type": "NS",
            "name": "@",
            "data": "ns3.digitalocean.com",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9663217,
            "type": "A",
            "name": "@",
            "data": "159.203.105.142",
            "priority": null,
            "port": null,
            "weight": null
        },
        {
            "id": 9687584,
            "type": "MX",
            "name": "@",
            "data": "@",
            "priority": 5,
            "port": null,
            "weight": null
        }
    ],
    "links": {

    },
    "meta": {
        "total": 5
    }
}



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

What is the domain and what records are you missing?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.