ElastiCacheのCache Clusterを作成すると、下記のようにConfiguration Endpointが利用できます。

このConfiguration Endpointを名前解決してみると下記のようになりました。

# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-54-249-151-184.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105

実はこのIPアドレスは、下記のようなCache NodeのIPアドレスでした。

# dig +noall +answer test.xxxxxx.0001.apne1.cache.amazonaws.com
test.xxxxxx.0001.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105

ただ、Cache Nodeは複数あるので、どのノードが割り当てられているのか、確認してみたところ、
下記のようにDNSのTTLが切れたら、他のノードに変わるような挙動をしていました。

# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 2 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 2 IN A yyy.yyy.16.246
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 1 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 1 IN A yyy.yyy.16.246
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 60 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 60 IN A yyy.yyy.15.105
# dig +noall +answer test.xxxxxx.cfg.apne1.cache.amazonaws.com
test.xxxxxx.cfg.apne1.cache.amazonaws.com. 59 IN CNAME ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com.
ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com. 59 IN A yyy.yyy.15.105

上記内容は下記ドキュメントを参照しました。

Connecting to Cache Nodes

The application resolves the configuration endpoint’s DNS name.
Because the configuration endpoint maintains CNAME entries
for all of the cache nodes, the DNS name resolves to one of the nodes;
the client can then connect to that node.

こちらの記事はなかの人(suz-lab)監修のもと掲載しています。
元記事は、こちら