July 29th, 2024

The weird and wonderful world of DNS LOC records

Cloudflare's RRDNS server, crucial for DNS requests, faced issues with LOC records due to a missing code link. A parser was implemented, ensuring proper handling of these records in their infrastructure.

Read original articleLink Icon
CuriosityNostalgiaInterest
The weird and wonderful world of DNS LOC records

Cloudflare's infrastructure relies on its ability to quickly serve DNS requests and mitigate DNS attacks, achieved through its proprietary authoritative DNS server, RRDNS, developed in Go. Despite the complexity of DNS, which has evolved since its inception in 1987, Cloudflare manages millions of DNS records, including a rare type known as LOC (location) records. These records specify physical locations, but only 743 LOC records exist in Cloudflare's database. A recent customer inquiry about an unserved LOC record prompted an investigation into RRDNS, revealing a missing code link that prevented the server from parsing LOC records correctly. The LOC record format, defined in RFC 1876, includes latitude, longitude, altitude, and optional size and precision values. The textual format is straightforward, while the on-the-wire format converts this data into a fixed-size binary format. To address the issue, a parser for the LOC text record type was created and implemented, allowing RRDNS to serve existing LOC records properly. The article illustrates the technical intricacies of DNS record handling and highlights the importance of even the least utilized record types in a large-scale DNS infrastructure. The successful resolution of the LOC record issue demonstrates Cloudflare's commitment to maintaining robust DNS services.

AI: What people are saying
The comments reflect a diverse range of thoughts and experiences related to LOC records in DNS.
  • Several users express surprise at the existence and functionality of LOC records, indicating a lack of awareness prior to the article.
  • There are discussions about the practical applications of LOC records, with some users suggesting creative uses like scavenger hunts and memorials.
  • Users share personal experiences and examples of using LOC records, highlighting both successes and failures in implementation.
  • Some comments reference past talks and articles, indicating a broader interest in the implications and security aspects of DNS features.
  • There is a sense of community engagement, with users asking questions and sharing resources related to LOC records.
Link Icon 18 comments
By @jgrahamc - 4 months
Back in 2014 when I wrote this I said "CloudFlare handles millions of DNS records; of those just 743 are LOCs." I asked the team for an update and that number is now... 3,198.
By @bonyt - 4 months
A friend of mine passed away last year and I use a domain named after her as a small memorial, sally.pro. I just gave it a LOC record pointing to a bench in the park that we adopted for her.
By @dgl - 4 months
While the example here is broken, http://find.me.uk still works:

  $ dig loc SW1A1AA.find.me.uk
  
  ; <<>> DiG 9.10.6 <<>> loc SW1A1AA.find.me.uk
  ;; global options: +cmd
  ;; Got answer:
  ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63530
  ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
  
  ;; OPT PSEUDOSECTION:
  ; EDNS: version: 0, flags:; udp: 512
  ;; QUESTION SECTION:
  ;SW1A1AA.find.me.uk.  IN LOC
  
  ;; ANSWER SECTION:
  SW1A1AA.find.me.uk. 21600 IN LOC 51 30 3.637 N 0 8 29.624 W 0.00m 0.00m 0.00m 0.00m
By @MiscIdeaMaker99 - 4 months
Bummer. The example in the articles doesn't work.

  # dig geekatlas.com LOC @1.1.1.1
  
  ; <<>> DiG 9.20.0 <<>> geekatlas.com LOC @1.1.1.1
  ;; global options: +cmd
  ;; Got answer:
  ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19487
  ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1,   ADDITIONAL: 1
  
  ;; OPT PSEUDOSECTION:
  ; EDNS: version: 0, flags:; udp: 1232
  ;; QUESTION SECTION:
  ;geekatlas.com.   IN LOC
  
  ;; AUTHORITY SECTION:
  geekatlas.com.  300 IN SOA ns1.namefind.com. dns.jomax.net.   2023031500 28800 7200 604800 300
  
  ;; Query time: 22 msec
  ;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
  ;; WHEN: Mon Jul 29 08:46:31 EDT 2024
  ;; MSG SIZE  rcvd: 104
By @dpifke - 4 months
LOC on reverse DNS seems a much more elegant solution than RFC 8805 Geofeeds (https://www.rfc-editor.org/rfc/rfc8805).

In particular, it solves the discovery issue discussed in RFC 9092 (https://www.rfc-editor.org/rfc/rfc9092), allows real-time updates, and would make it easier for ISPs to delegate maintenance of geolocation records to customers.

By @LinuxBender - 4 months
I found this [1] for generating LOC records using Google Maps.

Verified it works on another machine, my daily driver was blocking something. Also verified coordinates that it generates.

[1] - https://dnsloc.net/

By @coolkil - 4 months
Firstly I never knew Loc records existed… interesting to read something like this.

Secondly I think cloudflare will see an (sizable???) increase in Loc records due to this article

By @philipwhiuk - 4 months
I naively assumed this would be about localised caching. You'd think straight-line distance would be a reasonable proxy for speed.

Hence you could have

* google.com <LOC San Francisco>

* google.com <LOC London>

and pick the right one

but that's not really how it works at all :(

By @mrngm - 4 months
Earlier (and only) submission in 2014: https://news.ycombinator.com/item?id=7508234

Perhaps the title of this post can be edited to include [2014] as well.

By @fanf2 - 4 months
I put a LOC record on cam.ac.uk set to 10km in diameter, so it basically covers the official precincts of the university which require that students live within 3 miles of the centre of the city.
By @teddyh - 4 months
See also: DNS LOC: Geo-enabling the Domain Name System <https://www.ckdhr.com/dns-loc/>
By @Neil44 - 4 months
I've just given us a LOC record, do I get a prize?
By @hurpdurpdurp - 4 months
One of many strange features in DNS. I seem to recall a talk a few years ago where someone enumerated a variety of weird DNS capabilities and some interesting security consequences, but I don't remember the name of the talk or the speaker. Does anyone happen to know what I'm half-remembering?
By @ChilledTonic - 4 months
This is interesting, but can anyone give me an example of using this for beyond just a simple easter egg? Presumably this had some real use to be added to the DNS spec.
By @jasonjayr - 4 months
Hmm. Is there a tool to ping a list of LOC records and feed/update OSM automatically?
By @JohnMakin - 4 months
Would be fun to make a scavenger hunt game using these.
By @avipars - 4 months
Another good one is HINFO