Skip to main content

Cname for for root domain

Comments

17 comments

  • cPRex Jurassic Moderator
    Hey there! I'm not sure I totally understand the question. CNAME records are used when you want to point something to a domain name. For example, you could have this record: mail IN CNAME mail.domain.com
    The "@" in a DNS zone is just a shorthand way of not typing out the entire domain name, and is not related to a particular record type. Can you let me know what you're trying to do? Are you trying to point the content of domainA to domainB?
    0
  • coffeeboyuk
    Hey there! I'm not sure I totally understand the question. CNAME records are used when you want to point something to a domain name. For example, you could have this record: mail IN CNAME mail.domain.com
    The "@" in a DNS zone is just a shorthand way of not typing out the entire domain name, and is not related to a particular record type. Can you let me know what you're trying to do? Are you trying to point the content of domainA to domainB?

    Thanks for explaining about the shorthand. Let me explain in more details: Usually, we can write for A records: @ IN A 199.9.9.9 - Which resolves mydomain.com to 199.9.9.9 But I want mydomain.com to resolve to a CNAME. So for example if CNAME goes to this.domain.com then mydomain.com will resolve to this.domain.com and not an ip address, how do I do it in? And the reason for this is because the ip address is changing from time to time so I've been given a cname to point to.
    0
  • cPRex Jurassic Moderator
    Thanks for the additional details. I don't see why you couldn't have a main domain point to a CNAME. You'd just want to replace the main "domain.com IN A x.x.x.x" with "domain.com IN CNAME otherdomain.com" and that would take care of it.
    0
  • coffeeboyuk
    Thanks for the additional details. I don't see why you couldn't have a main domain point to a CNAME. You'd just want to replace the main "domain.com IN A x.x.x.x" with "domain.com IN CNAME otherdomain.com" and that would take care of it.

    That's exactly what I want to do but cpanel won't accept this. What's the solution?
    0
  • coffeeboyuk
    Thanks for the additional details. I don't see why you couldn't have a main domain point to a CNAME. You'd just want to replace the main "domain.com IN A x.x.x.x" with "domain.com IN CNAME otherdomain.com" and that would take care of it.

    Are you sure that will work? Let me try it again then
    0
  • coffeeboyuk
    It doesn't work. I get the following error: (note: i replaced mydomain.com with an aliase for privacy reasons) Error: API failure: Zone is invalid: Line 14: mydomain.com: CNAME and other data; Line 14: mydomain.com: CNAME and other data; Line 14: mydomain.com: CNAME and other data; Line 25: mydomain.com: CNAME and other data at /usr/local/cpanel/Cpanel/ZoneFile/LineEdit.pm line 403. This is such fantastic feature that it works in other DNS zone but cpanel of all things "holy", does not work!
    0
  • cPRex Jurassic Moderator
    I did some more digging on this and found this: "A CNAME cannot be placed at the root domain level, because the root domain is the DNS Start of Authority (SOA) which must point to an IP address. CNAME records must point to another domain name, never to an IP address."
    0
  • coffeeboyuk
    I did some more digging on this and found this: "A CNAME cannot be placed at the root domain level, because the root domain is the DNS Start of Authority (SOA) which must point to an IP address. CNAME records must point to another domain name, never to an IP address."
    0
  • cPRex Jurassic Moderator
    There isn't a way to do this with only the DNS system that I am aware of.
    0
  • cPRex Jurassic Moderator
    Do you control both the domains on the same server? If so, you could create an Alias in cPanel so multiple domains point to the same content. Aliases | cPanel & WHM Documentation
    0
  • coffeeboyuk
    There isn't a way to do this with only the DNS system that I am aware of.

    That sucks. Can this be added as a feature?
    0
  • cPRex Jurassic Moderator
    No - this one isn't up to us, but is a restriction of DNS itself.
    0
  • coffeeboyuk
    Do you control both the domains on the same server? If so, you could create an Alias in cPanel so multiple domains point to the same content.
    0
  • cPRex Jurassic Moderator
    You wouldn't be able to add a second domain to their existing zone either. An Alias sets up a redirect inside the Apache configuration so two domains point to the same content. This way, you just use your standard A record and then the site points to the existing content.
    0
  • coffeeboyuk
    You wouldn't be able to add a second domain to their existing zone either. An Alias sets up a redirect inside the Apache configuration so two domains point to the same content. This way, you just use your standard A record and then the site points to the existing content.

    I'm not sure I understand, but when you say standard A record you mean having the record point to an IP address of the other server? If that's the case, that's not possible because the other server IP addresses changes now and again.
    0
  • coffeeboyuk
    Why don't you guys rebuild the DNS, so we can point the cname to another website address instead of pointing it to an IP address. We need great changes for the good of man kind.
    0
  • coffeeboyuk
    Hey guys, just an update but the root of the domain is working with just the cname. Hurrary. That's weird, though because you don't need the @ A record for mydomain.com. Need to back track what records is causing this to work though. CNAME resolves to mydomain.com - and it works!
    0

Please sign in to leave a comment.