Skip to content

Commit 1475354

Browse files
[DNS] Wildcard records docs review (#25877)
* Avoid bold for non-UI and consolidate specific records explanation * Remove remaining descr from previous version and add examples * Fix broken link
1 parent f2d0e86 commit 1475354

File tree

1 file changed

+33
-12
lines changed

1 file changed

+33
-12
lines changed

src/content/docs/dns/manage-dns-records/reference/wildcard-dns-records.mdx

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ sidebar:
88

99
import { Details, Example, Render } from "~/components"
1010

11-
Normal DNS records map a domain name to one or multiple IP addresses or other associated resources to a specific domain name (a one-to-many mapping).
12-
13-
Wildcard DNS records allow you to have a many-to-many mapping, for example if you had hundreds or thousands of subdomains you wanted to point to the same resources. Wildcard records are used as the response for all subdomains that are not specifically covered by another DNS record.
11+
Normal DNS records map a domain name to one or multiple IP addresses or other associated resources to a specific domain name (a one-to-many mapping). Wildcard DNS records allow you to have a many-to-many mapping, for example if you had hundreds or thousands of subdomains you wanted to point to the same resources.
1412

1513
Within Cloudflare, wildcard DNS records can be either [proxied or DNS-only](/dns/proxy-status/).
1614

@@ -46,28 +44,49 @@ You can also create a wildcard DNS record specifically for a deeper subdomain. F
4644

4745
### Aspects to consider
4846

49-
* **Wildcards are only supported on the first label**: This means that a hostname such as `subdomain.*.example.com` is not a wildcard on the level of the asterisk character. If you create a DNS record with that name, the asterisk is interpreted as the literal character `*` and not as the wildcard operator.
47+
#### Wildcards are only supported on the first label
48+
49+
This means that a hostname such as `subdomain.*.example.com` is not a wildcard on the level of the asterisk character. If you create a DNS record with that name, the asterisk is interpreted as the literal character `*` and not as the wildcard operator.
50+
51+
#### Wildcards are multi-level by default
5052

51-
* **You cannot create wildcards on multiple levels**: If you create a DNS record on `*.*.example.com`, only the first asterisk is interpreted as a wildcard while the second one is interpreted as the literal `*` character.
53+
If you create a DNS record on `*.*.example.com`, only the first asterisk is interpreted as a wildcard while the second one is interpreted as the literal `*` character. A record `*.example.com` is already multi-level by default, meaning it would cover `abc.example.com` as well as `123.abc.example.com`, as long as there are no [specific DNS records](#specific-dns-records-take-precedence-over-wildcard-records) that would take precedence.
5254

53-
* **Specific DNS records take precedence over wildcard records**: Wildcards will be applied for multiple levels, but a specific record on any equal or lower level will terminate anything on or below this specific record.
55+
#### Specific DNS records take precedence over wildcard records
5456

57+
A wildcard record applies only when no exact record exists at the queried name. If a record or delegation exists, the wildcard does not apply.
5558

56-
<Details header="Example">
59+
<Details header="Example 1 - specific or below">
5760

58-
If you have only these two records on your domain, `A` and `TXT`:
61+
If you have only these two records on your domain:
5962

6063
| Type | Name | Content |
6164
| ----- | ------------------------- | ------------- |
62-
| `A` | `*.example.com` | `192.0.2.3` |
63-
| `TXT` | `subdomain1.example.com ` | `<some_text>` |
65+
| `A` | `*` | `192.0.2.1` |
66+
| `TXT` | `abc` | `<some_text>` |
6467

65-
The `A` wildcard record will be used for queries going to any subdomain of `example.com` except `subdomain1.example.com` or anything below that specific label (`deeper.label.subdomain1.example.com`).
68+
The `A` wildcard record will be used for queries going to any subdomain of `example.com` except `abc.example.com` or anything below that specific label (`123.abc.example.com` or `deeper.label.abc.example.com`, and so on).
6669

67-
The wildcard will still be used for deeper labels that are not below the specific record on `subdomain1.example.com` — for example, `deeper.label.subdomain2.example.com`.
70+
The wildcard will still be used for deeper labels that are not below the specific record on `abc.example.com` — for example, `deeper.label.xyz.example.com`.
6871

6972
</Details>
7073

74+
<Details header="Example 2 - implicit parent">
75+
76+
If you have only these two records on your domain:
77+
78+
| Type | Name | Content |
79+
| ----- | ------------------------- | ------------- |
80+
| `A` | `*` | `192.0.2.1` |
81+
| `TXT` | `123.abc` | `<some_text>` |
82+
83+
In this example, `123.abc.example.com` is a descendant of `abc.example.com`, and `abc.example.com` has no records associated with it. The behavior will depend on the type of nameservers you are using:
84+
85+
- Standard nameservers: The wildcard `*.example.com` will still apply to `abc.example.com`.
86+
- [Advanced nameservers](/dns/foundation-dns/setup/)[^1]: In compliance with [RFC 4592](https://www.rfc-editor.org/rfc/rfc4592.html), the wildcard `*.example.com` will not apply to `abc.example.com`.
87+
88+
</Details>
89+
7190
## Availability
7291

7392
Customers on all plans can create and proxy wildcard DNS records.
@@ -81,3 +100,5 @@ If you are using a [partial (CNAME) setup](/dns/zone-setups/partial-setup/) for
81100
## Additional information
82101

83102
For more information on wildcard records — as well as more details about their limitations — refer to the [introductory blog post](https://blog.cloudflare.com/wildcard-proxy-for-everyone/).
103+
104+
[^1]: An opt-in configuration available for Enterprise customers.

0 commit comments

Comments
 (0)