The Domain Name System (DNS) has a little known 'LOC' resouce record (RR) defined in 1996 for encoding location information purportedly for hosts, networks, and subnets[0].

It encodes:

A number of suggested uses are proposed in the RFC:

RFC-1876 also describes algorithms for resolving locations for domain names or IP addresses with decreasing accuracy. It still refers to classful addressing, despite being published 3 years after CIDR[1], probably because the algorithm it was adapted from was published in 1989.

An aside: find.me.uk can be used to get the location of any UK postcode, e.g. $ dig loc cb30fd.find.me.uk.

There are a few notable issues with the DNS LOC RR.

High-precision LOC RR information could be used to plan a penetration of physical security, leading to potential denial-of-machine attacks. To avoid any appearance of suggesting this method to potential attackers, we declined the opportunity to name this RR "ICBM"[0].

CloudFlare handles millions of DNS records; of those just 743 are LOCs[2].

[0] - RFC-1876 A Means for Expressing Location Information in the Domain Name System
[1] - RFC-1518-An Architecture for IP Address Allocation with CIDR
[2] - The weird and wonderful world of DNS LOC records