[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2234
  • Last Modified:

creating CNAME instead of A record for subdomain parent using Linux NAMED

Hello,

Not sure if I'm able to explain this correctly, but here it goes.  

I want to create a CNAME instead of an A record that resolves the parent subdomain to an A record of a different domain.  

For example, this is the current zone file.
$ORIGIN .
$TTL 300        ; 2 hours
mydomain.ca                 IN SOA  ns1.mydns.com. dnsadmin.mydomain.com. (
                                2009021201 ; serial
                                600        ; refresh (1 hours)
                                300        ; retry (2 hours)
                                950400     ; expire (1 week 4 days)
                                300        ; minimum (2 hours)
                                )
                        NS      ns1.mydns.com.
                        MX      0 mail.myotherdomain.com.
                  A      123.132.123.123    <--- THIS IS WHAT I WANT CHANGED TO CNAME
                        TXT     "v=spf1 a mx ptr -all"
$ORIGIN mydomain.ca.
www                     CNAME   mydomain.ca.


Is it possible, to mimic how Active Directory DNS allows for CNAMEs to be created as (same as parent folder) instead of the inital 'A' record?

Something like this....

$ORIGIN .
$TTL 300        ; 2 hours
mydomain.ca                 IN SOA  ns1.mydns.com. dnsadmin.mydomain.com. (
                                2009021201 ; serial
                                600        ; refresh (1 hours)
                                300        ; retry (2 hours)
                                950400     ; expire (1 week 4 days)
                                300        ; minimum (2 hours)
                                )
                        NS      ns1.mydns.com.
                        MX      0 mail.myotherdomain.com.
                        TXT     "v=spf1 a mx ptr -all"
$ORIGIN mydomain.ca.
(same as parent)      CNAME   myotherdomain.com.     <--- THIS IS WHAT I WANT ADDED BUT DON'T KNOW THE SYNTAX
www                     CNAME   mydomain.ca.



Thanks in advance!



0
jstpierre
Asked:
jstpierre
  • 2
1 Solution
 
ittogoCommented:
you need to define the A record first and then point the CNAME to it.

www.mydomain.com  IN A 123.123.123.123
www.otherdomain.com IN CNAME www.mydomain.com
0
 
jstpierreAuthor Commented:
In Active Directory, a CNAME can be used for the parent subdomain instead of creating an 'A' record.

ie.   mydomain.com can be CNAMED to mydomain.ca

www and other subdomains aren't a problem...

Can this be done under Linux?


0
 
ittogoCommented:
try

mydomain.com.   CNAME mydomain.ca.
0
 
Chris DentPowerShell DeveloperCommented:

You really should not do that if the zone is public.

While it might work in some situations it is not RFC compliant (the resource is already used by SOA and NS records) and not all DNS servers / resolvers will correctly read the record if you use a CNAME instead of an A record.

Chris
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now