Closed ryanramage closed 4 years ago
Okay that's interesting. Could you tell me a little more about what information you're putting in the record?
Seems to be storing latitude / longitude info in DNS records for this project
In my case I need to store a lat/lon coord in the same txt record as @RangerMauve pointed out.
I am working on way for organizations to use dns + dat to publish geojson information. So for example a city wants to manage and publish its neighbourhoods. something like
oliver.neighbourhoods.edmonton.ca mccauley.neighbourhoods.edmonton.ca
each DNS has a TXT record that looks like
datkey=3390cfcc601a97174f1221aa7277e0e5b49e5f3e973e4edecac0c66791c882c4;l=53.52294522577663,-113.30244317650795
The lat/lon is the center point, and the datkey specifies a way to get the full geojson shape of the neighbourhood. the geojson would be at dat://3390cfcc601a97174f1221aa7277e0e5b49e5f3e973e4edecac0c66791c882c4/oliver.neighbourhoods.edmonton.ca
Some consumers of the text record are just interested in the point itself, while some want both.
I have wrestled with having 2 TXT records, but this is not supported by all nameservers. A lot of text records use delimiters in their entries to allow more than one key value. (see DMARC https://en.wikipedia.org/wiki/TXT_record#Example_usage)
Basically a small relaxation of what dat is looking for would allow for some flexibility. It allows the current standard usage, and allows some flexibility for use cases such as mine.
Okay that makes sense. Let me talk it through with the folks (we'll bring it up at the WG this wednesday) and see if anybody has opinions about this.
Okay WG is 👍 for this. We'll merge the dat-dns PR. Would you mind also creating a PR for https://github.com/datprotocol/DEPs/blob/master/proposals/0005-dns.md ?
fantastic, I will create a PR as advised.
Thanks!
👍 Published 4.0.2
Currently, the implementation of the dat TXT record has a very greedy regex that only allows for a datkey=value
I am working on an app that uses dat, but also needs to store extra key values in the same TXT record. The proposal is to relax the regex slights, so that a datkey could be mixed with other key values in the same TXT record.
In my case the TXT record would look like:
But I am not proposing what the delimiters will be in any way. And I would not recommend any delimiters. Leave that part flexible.
So I have put together a pull request that relaxes the regex slightly, and would allow for other use cases of the same TXT record. No delimiters are specified, and all current TXT records would function fine.
https://github.com/datprotocol/dat-dns/pull/19#issuecomment-524503841