3.1.5.10. Wildcard entry (*)
In system DNS you can set a default entry for undeclared subdomains. This entry is called a wildcard.
The entry is created by specifying the symbol *
in the subdomain field. The principle of operation of such a record is quite simple — if the requested subdomain or its parent was not explicitly specified in any record, then a wildcard record (roughly speaking, the default record) will be taken. This is convenient for setting up a large number of subdomains, since you do not need to add a separate entry for each subdomain. By default when adding or registration domain, two wildcard entries are created: of type A and type AAAA.
Principle of operation
For example, for the domain example.com
the following records are created:
Subdomain | Type | Data |
---|---|---|
example.com | A | 1.XXX.XXX.XXX |
www.example.com | A | 1.XXX.XXX.XXX |
*.example.com | A | 2.XXX.XXX.XXX |
sub.example.com | A | 3.XXX.XXX.XXX |
*.domain.example.com | A | 4.XXX.XXX.XXX |
form.domain.example.com | A | 5.XXX.XXX.XXX |
anothersub.example.com | TXT | XXXXXXXXXXXX |
In the case described above, the wildcard entry will be valid for any subdomains except sub
, anothersub
and their subdomains, and for all subdomains domain
its wildcard entry will be used. For example:
- Request for
www.example.com
will return record 1.XXX.XXX.XXX. - Request for
sub.example.com
will return the record 3.XXX.XXX.XXX. - Request for
some.sub.example.com
will not return an entry because it is not specified. Wildcard entry will not be applied, since the subdomainsub
was announced. - Request for
sub.anothersub.example.com
will not return an entry because it is not specified. Wildcard entry will not be applied, since the subdomainanothersub
was announced. - Request for
anothersub.example.com
will return the TXT record XXXXXXXXXXXX. - Request for
like.domain.example.com
will return the record 4.XXX.XXX.XXX. - Request for
domain.example.com
will return record 4.XXX.XXX.XXX (wildcard record is used*.domain
). - Request for
form.domain.example.com
will return the record 5.XXX.XXX.XXX. Wildcard entry will not be applied, since the subdomainform.domain.
was announced. - Request for
test.example.com
will return record 2.XXX.XXX.XXX (wildcard record is used*
). - Request for
sub.www.example.com
will not return an entry because it is not specified. Wildcard entry will not be applied, since the subdomainwww
was announced. - Request for
poddomen.example.com
will return record 2.XXX.XXX.XXX (wildcard record is used*
).