Score:0

DNS priority with *.domain and *.subdomain.domain resolution

co flag

I have a DNS zone hosted on Google Cloud DNS with records similar to:

(assume the zone is example.com, and there are SOA and NS records for the zone root):

example.com          A       10.20.30.40      # <- points to some real IP address
*.example.com        CNAME   example.com      # everything else is a CNAME to example.com
*.sub1.example.com   CNAME   example.com
*.sub2.example.com   CNAME   example.com

Now:

  • Resolving sub-sub domains like foo.sub1.example.com and blah.sub2.example.com works as expected.
  • Resolving hostnames other than sub1 and sub2, such as foo.example.com and sub3.example.com works as expected.
  • Resolving sub1.example.com and sub2.example.com does not work.

I was expecting that sub1.example.com would match *.example.com and be resolved to CNAME example.com, but this isn't the case.

I can easily work around this by adding explicit CNAME records for sub1.example.com and sub2.example.com but I'm wondering if this is really required.

Is this the expected behavior for all DNS? Or mayble just for Google Cluod

John Hanley avatar
cn flag
CNAMES have strange limitations. Technically, if you create ***.example.com** then you cannot also create **sub1.example.com**. Read the RFCs on CNAMES.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.