5

I want to insulate myself from changes to the domain of the server we're using. For example, right now we need to point to:

www.oursite.com.    IN  CNAME   www.myserver.com.

But the service we're using to host the site is changing it so we have to change the CNAME of every domain we have pointed to their new domain:

www.oursite.com.    IN  CNAME   www.myserver-two.com.

Since we have over a hundred domains that we must make this change to, we want to insulate ourselves in case this happens again in the future. Is it valid to setup a single domain ourselves:

www.corpsite.com.  IN CNAME  www.myserver-two.com.

And then point all of our other domains to that one:

www.oursite.com.   IN CNAME  www.corpsite.com.

Such that www.oursite.com will route through www.corpsite.com and end up hitting the correct server at www.myserver-two.com?

EDIT:

We have attempted this on one of the domains and it... appears to be working, but we cannot ping it (pings timeout). So we're not sure if it's just "accidentally" working, and what other issues there might be to doing things this way.

And this is what happens when I ping it:

$ ping www.oursite.com
PING us-east-1-a.route.myserver-two.com (scrubbed): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3

I think this is unrelated - I believe the server we're using is dropping ICMP packets.

5
  • First, don't ping them. Use dig (dig +short domain.tld @nameserver). Second, every domain in DNS should end with a dot.
    – JohannesM
    Sep 16, 2014 at 17:07
  • Huh? I did use dig, and it appears to show correctly (A chain of CNAMEs) - but why doesn't a ping work? If dig works, shouldn't I be able to ping the domain? That the lack of dots was just a typo - I've corrected it.
    – nzifnab
    Sep 16, 2014 at 17:12
  • 1
    @nzifnab In what way does ping fail? Name resolution error or just no responses to the ICMP echo requests? The latter would seem unrelated to the question. Sep 16, 2014 at 17:22
  • Looks like no responses to ICMP. I put the ping output into the question.
    – nzifnab
    Sep 16, 2014 at 17:34
  • @nzifnab If "scrubbed" represents the correct IP it would seem that everything worked as you intended in terms of DNS. Sep 16, 2014 at 17:35

1 Answer 1

9

The standards discourage such a solution.

It probably works with most DNS software, but your clients might encounter some which is not willing to follow multiple CNAMEs in succession. In that case, those clients using such a DNS resolver will likely not be able to access your service using those domain names.

In RFC1034:

Domain names in RRs which point at another name should always point at the primary name and not the alias.

Of course, by the robustness principle, domain software should not fail when presented with CNAME chains or loops; CNAME chains should be followed and CNAME loops signalled as an error.

Not the answer you're looking for? Browse other questions tagged .