Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ sidebar:

---

import { Example } from "~/components"
import { Example, Render } from "~/components"

When you add a domain to Cloudflare, you may also need to create a DNS record on your zone apex (`example.com`).

To do this, create a corresponding [`A`, `AAAA`, or `CNAME` record](/dns/manage-dns-records/how-to/create-dns-records/) using `@` for the **Name**.
To do this, create an [IP address resolution record](/dns/manage-dns-records/reference/dns-record-types/#ip-address-resolution) (`A`, `AAAA`, or `CNAME`) using `@` for the **Name**, as in the following example.

<Example>

Expand All @@ -20,6 +20,11 @@ To do this, create a corresponding [`A`, `AAAA`, or `CNAME` record](/dns/manage-

</Example>

<Render file="dns-record-steps" product="dns" params={{
name: "your zone apex",
example: "@"
}} />

## Domain redirects

Once you create a domain, you may want to route that traffic to other places.
Expand Down
14 changes: 10 additions & 4 deletions src/content/partials/dns/create-subdomain-record.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@

---

import { Example } from "~/components"
import { Example, Render } from "~/components";

Most subdomains serve a specific purpose within the overall context of your website. For example, `blog.example.com` might be your blog, `support.example.com` could be your customer help portal, and `store.example.com` would be your e-commerce site.

## Subdomain records

To create a new subdomain, you would first add the subdomain content at your host.
To create a new subdomain, you would first add the subdomain content at your [host](/fundamentals/setup/manage-domains/#host-your-domain).

Then, you would create a corresponding [`A`, `AAAA`, or `CNAME` record](/dns/manage-dns-records/how-to/create-dns-records/) for that subdomain (`blog`, `store`).
Then, you would create a corresponding [IP address resolution record](/dns/manage-dns-records/reference/dns-record-types/#ip-address-resolution) (`A`, `AAAA`, or `CNAME`), specifying the subdomain (`blog`, `www`, or `store`, for example) as the record **Name**.

<Example>

| Type | Name | IPv4 address | Proxy status |
| ---- | ----- | ------------ | ------------ |
| A | `www` | `192.0.2.1` | Proxied |
| A | `blog` | `192.0.2.1` | Proxied |

</Example>


<Render file="dns-record-steps" product="dns" params={{
name: "your subdomain",
example: "blog"
}} />
27 changes: 27 additions & 0 deletions src/content/partials/dns/dns-record-steps.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
params:
- name
- example
---

import { Tabs, TabItem, Render, GlossaryTooltip } from "~/components";

<Tabs syncKey="dashPlusAPI">
<TabItem label="Dashboard">
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and zone.
2. Go to **DNS** > **Records** and select **Add record**.
3. Select `A`, `AAAA`, or `CNAME` as the record **Type**, according to your needs:
- To point to an IPv4 address, select `A`, use {props.name} (<code>{props.example}</code>) for the record **Name**, and insert the IPv4 address in the respective field.
- To point to an IPv6 address, select `AAAA`, use {props.name} (<code>{props.example}</code>) for the record **Name**, and insert the IPv6 address in the respective field.
- To point to a [fully qualified domain name (FQDN)](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) (such as `your-site.host.example.com`), select `CNAME`, use {props.name} (<code>{props.example}</code>) for the record **Name**, and insert the fully qualified domain name in the **Target** field.
4. Specify the <GlossaryTooltip term="proxy status" link="/dns/manage-dns-records/reference/proxied-dns-records/">**Proxy status**</GlossaryTooltip> and <GlossaryTooltip term="time-to-live (TTL)" link="/dns/manage-dns-records/reference/ttl/">**TTL**</GlossaryTooltip> according to your needs.
5. Select **Save** to confirm.
</TabItem>
<TabItem label="API">
Use the [Create DNS Record API endpoint](/api/operations/dns-records-for-a-zone-create-dns-record).
<Render file="api-field-definitions" product="dns"/>
- To point to an IPv4 address, select **A Record**, use {props.name} (<code>{props.example}</code>) for the field `name`, and use the IPv4 address for the field `content`.
- To point to an IPv6 address, select **AAAA Record**, use {props.name} (<code>{props.example}</code>) for the field `name`, and use the IPv6 address for the field `content`.
- To point to a [fully qualified domain name (FQDN)](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) (such as `your-site.host.example.com`), select **CNAME Record**, use {props.name} (<code>{props.example}</code>) for the field `name`, and use the fully qualified domain name for the field `content`.
</TabItem>
</Tabs>
Loading