We help IT Professionals succeed at work.

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

jstpierre
jstpierre asked
on
Medium Priority
2,381 Views
Last Modified: 2012-06-21
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!



Comment
Watch Question

Commented:
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

Author

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?


Commented:
try

mydomain.com.   CNAME mydomain.ca.
PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:

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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.