# How to access addresses through a root domain (ANAME)

import DocButton from '~/components/webkit/DocButton.vue';
import Tabs from '~/components/tabs/Tabs'
import Code from '~/components/Code/Code.astro'


You can configure your **Edge DNS** to allow access to an address through its root domain, also known as naked domain or apex domain, by using an **ANAME record**.

For this guide, assume you're configuring a record for a zone with the `domain.com` root domain.

<DocButton href="/en/documentation/products/guides/secure/add-records/" label="go to add records guide" kind="secondary" size="medium" />

---

<Tabs client:visible>
    <Fragment slot="tab.console">Console</Fragment>
    <Fragment slot="tab.api">API</Fragment>

<Fragment slot="panel.console">
1. Follow the general steps described in the [How to add records](/en/documentation/products/guides/secure/add-records/) guide.
2. In **Name**, enter `@`. This way, you'll use your root domain, `domain.com`.
3. In the **Record Type** dropdown menu, select **ANAME**.
4. In **Value**, add the IP addresses you want to make available through the root domain. Must be in FQDN format. Example: `32082s.map.azionedge.net`
5. Choose the type of **Policy**: **Simple** or **Weighted**.
6. Click the **Save** button.
</Fragment>

<Fragment slot="panel.api">
1. Run the following `GET` request in your terminal, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) to retrieve your `<hosted_zone_id>`:

<Code lang="bash" code={`
curl --request GET \
  --url https://api.azion.com/v4/edge_dns/zones \
  --header 'Accept: application/json' \
  --header 'Authorization: Token [TOKEN VALUE]'
`} />

2. You'll receive a response with all your existing zones. Copy the value of the `<id>` that you want to use.
3. Run the following `POST` request, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) and the `<zone_id>` value you copied:

<Code lang="bash" code={`
curl --request POST \
  --url https://api.azion.com/v4/edge_dns/zones/<zone_id>/records \
  --header 'Accept: application/json' \
  --header 'Authorization: Token [TOKEN VALUE]' \
  --header 'Content-Type: application/json' \
  --data '{
    "type": "ANAME",
    "name": "@",
    "rdata": ["xxxxx.map.azionedge.net"],
    "ttl": 20
  }'

`} />


4. You'll receive a response similar to this:

<Code lang="json" code={`
{
  "results": {
    "answers_list": [
      "32082s.map.azionedge.net"
    ],
    "zone_id": 1234,
    "record_type": "ANAME",
    "ttl": 0,
    "policy": "simple",
    "entry": "",
    "id": 12345,
    "description": ""
  },
  "schema_version": 3
}
`} />

Wait a few minutes for the changes to propagate and your records will be created in the hosted zone you chose.

:::tip
Check the [Azion API documentation](https://api.azion.com/) to know more about what the Azion API can offer.
:::
</Fragment>

</Tabs>
---