Solution 1:

The naive answer to your question is a simple "yes". You obviously can create CNAME RRs in the suggested fashion. Which problems may arise thereof, is an entirely different matter - CNAMES are commonly misunderstood and the usage is prone to errors.

Main points to consider are:

  • you must not use your CNAMEs as destinations for MX RRs (RFC 2181 section 10.3)
  • you must not create any other RR type definitions for the labels you are defining as CNAMEs (STD 13, RFC 1034, section 3.6.2)

So, taking the RR definitions from your question as a prerequisite, the following cases would present invalid use:

; these are INVALID RR definitions, don't even try!
mail.example.com.     IN MX  client1.mydomain.com. ; no MX to CNAME RRs
client1.mydomain.com. IN A   198.51.100.203        ; no other RR types for CNAMEd labels

In future posts, when using IP addresses and name spaces for example and / or documentation purposes, consider sticking to the definitions of IPv4 Address Blocks reserved for Documentation (RFC 5737) and Special-Use Domain Names (RFC 6761) to avoid confusion.