Is it possible to have a DNS wildcard with a suffix in the subdomain?
Example:
A Record:
*foo.example.com -> 192.0.2.1
Resolves:
test1-foo.example.com
test2-foo.example.com
test3-foo.example.com
Is this possible? Or, does the wildcard require the entire subdomain like *.example.com
>Solution :
Is it possible to have a DNS wildcard with a suffix in the subdomain?
No.
Wildcards do not work that way.
See RFC8499 and RFC4592 for all explanations, especially the second one.
2.1.1. Wildcard Domain Name and Asterisk Label
A "wildcard domain name" is defined by having its initial (i.e.,
leftmost or least significant) label be, in binary format:0000 0001 0010 1010 (binary) = 0x01 0x2a (hexadecimal)The first octet is the normal label type and length for a 1-octet-
long label, and the second octet is the ASCII representation [RFC20]
for the ‘*’ character.
So in short *foo is NOT a wildcard per DNS rules.