0

I currently have a zone which looks like this roughly:

www1 A 10.0.0.1
www2 A 10.0.0.2
www3 A 10.0.0.3

I want to have a round robin record for those IP, of course this can be achieved by adding the following:

www A 10.0.0.1
www A 10.0.0.2
www A 10.0.0.3

But this seems highly repetitious and my developer autism kicks in hard,

Conceptually I'd like to do the following:

www CNAME www1
www CNAME www2
www CNAME www3

This is apparently frowned upon, and not supported by the spec, but how would you solve this and adhere to the spec?

is there an elegant solution in DNS terms?

hbogert
  • 411
  • 1
  • 4
  • 18

2 Answers2

0

No, CNAME is an alias, it can only be used once.

What you can do is omit the name:

www IN A 10.0.0.1
    IN A 10.0.0.2
    IN A 10.0.0.3

The IN is also optional, so you can abbreviate this to

www A 10.0.0.1
    A 10.0.0.2
    A 10.0.0.3
Simon Richter
  • 3,209
  • 17
  • 17
  • Maybe I should've highlighted this more, but the problem isn't with the repetition of the www, but with the repeated IP addresses for the RRs **and** the specific hostentries, www{1,2,3} in my example. To iterate, I want both the RRs and the distinct host addresses. – hbogert Jul 31 '20 at 14:23
0

If your DNS provider supports ALIAS records, use those. Otherwise do the repetition.

tater
  • 1,395
  • 2
  • 9
  • 12