You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/dns/manage-dns-records/reference/wildcard-dns-records.mdx
+33-12Lines changed: 33 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,7 @@ sidebar:
8
8
9
9
import { Details, Example, Render } from"~/components"
10
10
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.
14
12
15
13
Within Cloudflare, wildcard DNS records can be either [proxied or DNS-only](/dns/proxy-status/).
16
14
@@ -46,28 +44,49 @@ You can also create a wildcard DNS record specifically for a deeper subdomain. F
46
44
47
45
### Aspects to consider
48
46
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
50
52
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.
52
54
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
54
56
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.
55
58
56
-
<Detailsheader="Example">
59
+
<Detailsheader="Example 1 - specific or below">
57
60
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:
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).
66
69
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`.
68
71
69
72
</Details>
70
73
74
+
<Detailsheader="Example 2 - implicit parent">
75
+
76
+
If you have only these two records on your domain:
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
+
71
90
## Availability
72
91
73
92
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
81
100
## Additional information
82
101
83
102
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