I love DNS esoterica. Weird little things that you can shove in the global directory to be distributed around the world instantly(ish).
Domain names, like www.example.com
usually resolve to servers. As much as we think of "the cloud" as being some intangible morass of ethereal Turing-machines floating in probability space, the more prosaic reality is that they're just boxen in data centres. They have a physical location.
Got a tricky machine which is playing silly-buggers? Wouldn't it be nice to know exactly where it is? That way you can visit and give it some percussive maintenance.
Enter the DNS LOC record!
The snappily titled RFC 1876 is an experimental standard. It allows you to create a DNS record which specifies the latitude and longitude of your server. Of course, some data-centres are very tall and some are underground. So it also contains an altitude parameter.
The standard allows for a minimum altitude of -100,000 metres - deep enough for any bunker! The maximum altitude is 42,849,672 metres which is high enough to allow it to be used on satellites in geostationary orbit.
So, as a bit of fun, I decided to create where-is-the-iss.dedyn.io
It isn't a website. You can't ping it. There's no way to interact with it except by using DNS. Yup! You can use a DNS query to get the (approximate) location of the International Space Station!
Linux and Mac users0 can run:
dig where-is-the-iss.dedyn.io LOC
And receive back the latest position of the ISS:
;; ANSWER SECTION:
where-is-the-iss.dedyn.io. 1066 IN LOC 47 24 53.500 N 66 12 12.070 W 430520m 10000m 10000m 10000m
The DNS records are updated every 15 minutes on a best-effort basis1.
How
The lovely people at N2YO have a website which allows you to track loads of objects in orbit. They also have an easy to use API with a generous free tier.
Calling https://api.n2yo.com/rest/v1/satellite/positions/25544/0/0/0/1/&apiKey=_____
gets back the latest position:
JSON
{ "info": { "satname": "SPACE STATION", "satid": 25544, "transactionscount": 7 }, "positions": [ { "satlatitude": -21.25409321, "satlongitude": 140.3335763, "sataltitude": 420.09, "azimuth": 292.92, "elevation": -70.95, "ra": 202.69300845, "dec": -32.16097472, "timestamp": 1751366048, "eclipsed": true } ] }
Note that the altitude is in Km, whereas the LOC format requires m.
The latitude and longitude are in decimal format - they need to be converted to Degrees, Minutes, and Seconds.
There were only a few free domain name providers who offer an API for updating LOC records. I went for deSEC a charity from Berlin. They have comprehensive API documentation.
Adding the initial LOC record is done with:
Bash
curl https://desec.io/api/v1/domains/where-is-the-iss.dedyn.io/rrsets/ \ --header "Authorization: Token _______" \ --header "Content-Type: application/json" --data @- <<< \ '{"type": "LOC", "records": ["40 16 25.712 S 29 32 36.243 W 427550m 0.00m 10000m 10m"], "ttl": 900}'
However, updating the record is a little trickier. it needs to be sent as an HTTP PATCH to a subtly different URl. The PATCH only needs to send the data which have changed.
Bash
curl -X PATCH https://desec.io/api/v1/domains/where-is-the-iss.dedyn.io/rrsets/@/LOC/ \ --header "Authorization: Token _______" \ --header "Content-Type: application/json" --data @- <<< \ '{"records": ["40 16 25.712 S 29 32 36.243 W 427550m 0.00m 10000m 10m"]}'
I set the Time To Live at 900 seconds. Every 15 minutes my code runs to update the record2. That keeps me well within the API limits for both services. I could add TXT records showing when it was last updated, or other sorts of unstructured data, but I think this is enough for a quick proof-of-concept.
There you have it! A complex and silly way to demonstrate how DNS can be used to hold the most unlikely of records3. Say, I wonder how you'd represent the co-ordinates of the Mars Rover…?
Further Reading
For more DNS weirdness, please see my other posts:
-
I don't think there's a way for Windows users to look up LOC records using PowerShell or the Command Prompt. ↩︎
-
Look, I'm not NASA, OK? If you're using this to help you dock then I cannot be held responsible. ↩︎
-
I suppose you could build an API with unlimited request limits by distributing data via DNS TXT records. Would best suit static or infrequently updating data. Push it once to DNS and let everyone query it semi-locally. ↩︎
-
See if you can find the other interesting record I've added to DNS! ↩︎
14 thoughts on “Get the location of the ISS using DNS”
@Edent That's cool! You can also try talking to the folks on the ISS with your amateur radio. 😉
Reply to original comment on tootloop.com
|@Edent love this 🫶 exactly my jam these days! Thank you 🤗
Reply to original comment on mastodon.online
|Get the location of the ISS using DNS | Hacker News
Reply to original comment on news.ycombinator.com
|@blog took fn1 as a challenge:
nslookup -type=loc where-is-the-iss.dedyn.io
works in Powershell!Reply to original comment on screaminginsi.de
|@blog
This is utterly unhinged.
I appreciate that.
Reply to original comment on is.nota.live
|@Edent
It is a shame that neither
> Resolve-DnsName -Name where-is-the-iss.dedyn.io -Type LOC
nor
> nslookup -type=loc where-is-the-iss.dedyn.io
work.
Not even @rmbolger 's Resolve-Dns supports the LOC resource record type.
Although I suspect that might be the Windows tool that gains support the most quickly, just for the bragging rights of being able to show an ISS LOC record in Windows when no-one else can. (-:
#PowerShell #DNS #MicrosoftWindows #nslookup
dnsmicrosoftwindowsnslookuppowershell
Reply to original comment on mastodonapp.uk
|@blog i swear to god there's a DNS record for everything LMFAO
Reply to original comment on transfem.boywife.top
|@blog@shkspr.mobi Since I noted your post says you don't think there's a way to look this up on Windows, dog works: https://github.com/ogham/dog
Reply to original comment on fedi.gareth-coles.dev
|Een Britse ontwikkelaar heeft een manier gemaakt om de locatie van het ISS op te vragen via een DNS-verzoek. Er zit een functie in DNS om de locatie van een server op te vragen en die gebruikt de ontwikkelaar om de locatie van het ISS door te geven.
Reply to original comment on tweakers.net
|One Simple Test to Try Before Regulating the Internet.
Reply to original comment on internet.exchangepoint.tech
|科技爱好者周刊(第 356 期):公司强推 AI 编程,我该怎么办 - 阮一峰的网络日志
Reply to original comment on www.ruanyifeng.com
|What else could we host within DNS? https://shkspr.mobi/blog/2025/07/get-the-location-of-the-iss-using-dns/
With DIDs and DKIM and Nostr we already have identities.
What else?
Reply to original comment on kaspars.net
|Good Morning! I was at the AWS NYC Summit last week, where I learned a lot about Agentic AI and squat about much else, because that’s where all of the attention has gone. Increasingly I’m wondering who AWS events are for, because they’re not really for me anymore… From the Community I said that Route53 […]
Reply to original comment on www.lastweekinaws.com
|More comments on Mastodon.
Trackbacks and Pingbacks
[…] domeny, ale również na zapisanie informacji o lokalizacji serwera (włączając elewację). Ktoś dodał dwa do dwóch i stworzył adres www, który można odpytać komendą dig, aby uzyskać - właśnie w postaci […]