Skip to content

Add LOC record conversion into human-readable values #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phillip-stephens opened this issue Oct 2, 2024 · 1 comment
Open

Add LOC record conversion into human-readable values #460

phillip-stephens opened this issue Oct 2, 2024 · 1 comment
Milestone

Comments

@phillip-stephens
Copy link
Contributor

Currently we're just returning the raw DNS values for LOC record types.
Let's add parsing into human-readable values.
This would resolve the TODO here.

@phillip-stephens phillip-stephens self-assigned this Oct 2, 2024
@zakird zakird added this to the Version 2.1 milestone Oct 14, 2024
@zakird zakird changed the title [Feature Request] Add LOC record conversion into human-readable values Add LOC record conversion into human-readable values Jan 19, 2025
@phillip-stephens
Copy link
Contributor Author

phillip-stephens commented Apr 10, 2025

RFC explaining the LOC record
I've setup a LOC record @ loc.prstephens.com

dig gives nicely formatted output

$ dig -t LOC loc.prstephens.com

; <<>> DiG 9.10.6 <<>> -t LOC loc.prstephens.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23030
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;loc.prstephens.com.		IN	LOC

;; ANSWER SECTION:
loc.prstephens.com.	300	IN	LOC	37 25 26.000 N 122 9 57.000 W 30.00m 1m 1m 1m

;; Query time: 2339 msec
;; SERVER: 171.67.1.234#53(171.67.1.234)
;; WHEN: Thu Apr 10 10:02:50 PDT 2025
;; MSG SIZE  rcvd: 75

ZDNS does not.

$ ./zdns LOC loc.prstephens.com
00h:00m:01s; 0 names scanned; 0.00 names/sec; NaN% success rate;
{"name":"loc.prstephens.com","results":{"LOC":{"data":{"additionals":[{"flags":"","type":"EDNS0","udpsize":1232,"version":0}],"answers":[{"altitude":10003000,"class":"IN","horizontal_pre":18,"latitude":2282209648,"longitude":1707686648,"name":"loc.prstephens.com","size":18,"ttl":280,"type":"LOC","version":0,"vertical_pre":18}],"protocol":"udp","resolver":"171.64.1.234:53"},"duration":1.422555166,"status":"NOERROR","timestamp":"2025-04-10T10:03:11-07:00"}}}
00h:00m:01s; Scan Complete; 1 names scanned; 0.70 names/sec; 100.0% success rate; NOERROR: 1

Let's get the output to contain formatted output similar to dig with JSON keys matching what the RFC states.

Todos

  • Add a conversion function for taking raw LOC values -> Formatted GPS coords. Code pointer to the LOC object parsing
  • Add a unit test to check your function. Ex. of unit tests here
  • Open a PR and list the changes and what testing you've done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants