DNS servers such as
bind support redundancy by returning records in a round-robin fashion:
server A 126.96.36.199 ; country 1 server A 188.8.131.52 ; country 2
when a client requests the
A records above, multiple times,
bind permutes the addresses and returns them in a round-robin fashion.
An idea would be to return multiple records based on the geolocation of an incoming request and the destination IP address. This could majorly increase the speed between a server and a client given that metropolitan speed is much faster than international speed.
One could elaborate a little and perhaps determine distances as well, so that the “closest” IP is returned. As for “closest”, perhaps a hop-based estimation would suffice.
bind accepts connections directly, so
bind can tell the origin of a request. If that is so, then a
bind patch would suffice. Possibly easy by leveraging the already existing code for delivering round-robin records.