Advice on configuring multi-site Apple Caching server
Apple used to provide a Caching server as a module in Server.app but this is now built-in to the standard macOS operating system and configured via System Preferences -> Sharing
(It will cache copies of Apple software updates and items downloaded from both the Mac and iOS app stores.)
See - Manage content caching on Mac - Apple Support
It is possible to define a list of subnets that it should provide caching for, and also a list of public TCP/IP addresses used by both the Mac acting as the caching server and the clients you want to cache for. If you need a list of multiple public IP addresses you need to add this as a TXT record to your internal DNS server.
Now I fully understand all the above for use on a single site even if as I do I have multiple public IP addresses and multiple subnets. I also understand again on this single site how I could use multiple caching servers to spread the load. My difficulty is how I would deal with multiple sites as I will now detail.
We already have a second site linked via VPN to the main site. The second site has its own Internet link and hence has its own public IP address, the second site will obviously have different subnets for the clients. I would like to run a local caching server for this second site. The difficulty I am having is that both sites use the same DNS server, actually more accurately the second site uses a replica of the main site DNS server. Both sites also currently use the same default domain as advertised via DHCP.
The default domain defines the DNS record used to 'find' the TXT record advertising the public IP addresses to be used. See - Enable content cache discovery across multiple public IP addresses on Mac - Apple Support
So as things stand I can only define a single TXT record which would have to include the public IP addresses of both sites.
How do I ensure caching requests go to the correct local caching server? I could and would obviously on each caching server only define them to accept their respective local subnets for client requests. Is this all I need to do? I also want the caching servers themselves to go direct to Apple and not to each other.
Note: I believe a way of testing for the relevant DNS TXT record would be as follows.
nslookup -query=TXT _tcp._aaplcache.<default.domain.com>