> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get DNS Records

> Get the DNS records for your custom domain.

**A custom domain must already be attached to the application to use this route.** Custom domains are available on the [Standard plan](https://squarecloud.app/en/pricing) and above. This route is rate limited to 3 requests every 10 seconds.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

These are the records Cloudflare needs to validate ownership of the custom domain and issue its SSL certificate: typically one or two `txt` records (domain and ACME challenge validation) plus a `cname` record pointing at `cname.squareweb.app`, which is what actually routes traffic to the application. Add them at your domain registrar; Cloudflare polls for them automatically, no re-request needed.

The response is cached for 30 seconds per owner and application, and the same cache backs the Cubic AI agent when it inspects an application's domain setup. If the custom hostname has not been registered at the edge yet, the response is an empty array rather than an error.

To attach a custom domain in the first place, see [Set Custom Domain](/en/api-reference/endpoint/apps/network/custom). See also [List Domains](/en/api-reference/endpoint/apps/domains) for every hostname configured across your applications.

### Parameters

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  The ID of the application. You can find this in the URL of your application's dashboard.
</ParamField>

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseField name="response" type="array">
  The contents of the response.

  <Expandable title="Toggle object">
    <ResponseField name="type" type="string">
      The type of the DNS record.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the DNS record.
    </ResponseField>

    <ResponseField name="value" type="string">
      The value of the DNS record.
    </ResponseField>

    <ResponseField name="status" type="string">
      The status of the DNS record. It can be `pending_validation`, `pending` or `active`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status": "success",
    "response": [
      {
        "type": "txt",
        "name": "_acme-challenge.joaootavios.dev",
        "value": "hmo-jMx_KCWQU5CWG6xmrkI4AOZOJXlQtjEtc7zI1PA",
        "status": "pending_validation"
      },
      {
        "type": "cname",
        "name": "joaootavios.dev",
        "value": "cname.squareweb.app",
        "status": "pending"
      }
    ]
  }
  ```
</ResponseExample>

### Common errors

| Code               | HTTP | Meaning                                                 |
| ------------------ | ---- | ------------------------------------------------------- |
| `NO_CUSTOM_DOMAIN` | 400  | The application does not have a custom domain attached. |
