3.1.5.10. Wildcard record (*)

In the DNS system, it is possible to set a default record for undeclared subdomains. Such a record is called a wildcard.

A record is created by specifying the symbol * in the subdomain field. The operation principle of such a record is quite simple—if the requested subdomain, its parent, or child subdomain is not explicitly specified in any record, the wildcard record of the nearest parent will be used (in other words, the default record). This is convenient for configuring a large number of subdomains, as there is no need to add a separate record for each subdomain. By default, when adding or registering a domain, two wildcard records are created: of type A and of type AAAA.

For example, the following records have been created for the domain "example.com":

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
one.more.example.com TXT XXXXXXXXXXXX

In the case described above, the wildcard record will apply to all subdomains except:

  • sub — the subdomain was declared as it has records.
  • anothersub — the subdomain was declared as it has records.
  • sub.anothersub — the subdomain was declared because its parent has records.
  • more — the subdomain was declared because its descendant has records.
  • domain — the subdomain has been declared and has its own wildcard record, which it and all its descendants will use.
  • form.domain — the parent subdomain has been declared, so the wildcard record of the main name is not used, but the parent has its own wildcard record, which will be used.

Example of return values for different subdomains:

  • A request to www.example.com will return the record 1.XXX.XXX.XXX.
  • A request to sub.example.com will return the record 3.XXX.XXX.XXX.
  • The request to some.sub.example.com will not return a record, as it is not specified. The wildcard record will not be applied because the subdomain sub has been declared.
  • The request to sub.anothersub.example.com will not return a record, as it is not specified. The wildcard record will not be applied because the subdomain anothersub has been declared.
  • A request to anothersub.example.com will return the TXT record XXXXXXXXXXXX.
  • A request to like.domain.example.com will return the record 4.XXX.XXX.XXX.
  • A request to domain.example.com will return the record 4.XXX.XXX.XXX (a wildcard record *.domain is used).
  • A request to form.domain.example.com will return the record 5.XXX.XXX.XXX. The wildcard record will not be applied because the subdomain form.domain. has been declared.
  • A request to test.example.com will return the record 2.XXX.XXX.XXX (a wildcard record * is used).
  • The request for sub.www.example.com will not return a record, as it is not specified. The wildcard record will not be applied because the subdomain www has been declared.
  • A request to poddomen.example.com will return the record 2.XXX.XXX.XXX (a wildcard record * is used).
Content

    (4)

    Comments

    ihor02
    Корисно, дякую за роз'яснення