Hi,
then, at least for IPv4, you should check if the .local hostname points to a private subnet...
As this all becomes invalid for IPv6 (no, fe80:: is not the equivalent of the IPv4 private subnets), you will have to rely on the fact that people are able to configure their DNS correctly ...
KR,
G.