Dns 根据地理位置将域名映射到IP/服务器
假设我有一个名为Dns 根据地理位置将域名映射到IP/服务器,dns,geolocation,server,load-balancing,high-availability,Dns,Geolocation,Server,Load Balancing,High Availability,假设我有一个名为example.com的域,现在有两个客户端正在尝试连接它 +----------+ +-------------+ | Client 1 |\ | | +----------+ \ +--------------+ | | (East Asia)
example.com
的域,现在有两个客户端正在尝试连接它
+----------+ +-------------+
| Client 1 |\ | |
+----------+ \ +--------------+ | |
(East Asia) \---------> | | | |
| example.com | <---> | Server |
/---------> | | | |
+----------+ / +--------------+ | |
| Client 2 |/ (DNS) | |
+----------+ +-------------+
(North America) (sample application
server located in North America)
我的应用程序没有使用标准的HTTP
它是TCP
中的自定义协议,需要维护与客户端的连接
如何基于同一域名上的地理位置进行这种映射。考虑到DNS的分布式性质,您所要求的确实不容易做到(例如,考虑一下客户端1和客户端2都在使用Google的公共解析器8.8.8进行查找的情况)。如果你真的想这样做,那就开始查看主要DNS服务器服务公司的网页,看看他们中是否有提供这种服务的
一种可能更便宜、更简单的替代方法是在应用程序中添加一个步骤,在该步骤中,服务器检查连接的客户端来自何处,并可以告诉客户端软件“去与另一台服务器而不是我交谈”
+-------------+
| |
+----------+ | Server 1 |
| Client 1 |\ /--->| (Asia) |
+----------+ \ +--------------+ / | |
(East Asia) \---------> | |-/ +-------------+
| example.com | +-------------+
/---------> | |-\ | |
+----------+ / +--------------+ \ | Server 2 |
| Client 2 |/ (DNS) \--->| (N America) |
+----------+ | |
(North America) | |
+-------------+