Using DNS for failover using multiple A records

前端 未结 2 458
轮回少年
轮回少年 2021-02-02 10:09

It has recently come to my attention that setting up multiple A records for a hostname can be used not only for round-robin load-balancing but also for automatic failover.

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 11:06

    Another possible explanation is that, for most public websites, the bulk of traffic comes from bots not from browsers. Depending on the bot it is possible that they aren't quite as smart as the browsers when it comes to handling multiple A records for a domain.

    Also, some bots use keep-alives to keep the TCP connections open & make multiple HTTP requests over the same connection. Given that the DNS lookup is only done when a connection is made, they will continue to make requests to the old IP address at least as long as the connection is kept open.

    If the above explanation has any weight you should be able to see it in your logs by examining the user agent strings.

提交回复
热议问题