Expressions

Expressions are fundamental to rexdns functionality in CoreDNS, so they are important to cover before proceeding.

Expressions use a basic syntax similar in some ways to regular expressions. The available components of an expression are:

  • Wildcard matching with the * character, which can match any text, including nothing at all.

  • Bracketed sets with comma-separated values, such as [com, net, org].

  • Identifiers, which are single words per part, such as example.

Putting these concepts together, the following examples demonstrate a small sample of possible expressions:

*.example.com

Matches any host or subdomain under example.com.

www.*.com

Matches any domain with a www hostname under the com top-level domain.

www.example.[com,net,org].

Matches any of www.example.com, www.example.net, or www.example.org.

www.example.com

Matches www.example.com exactly.