# Distribution of Device ID using DNS TXT record

**URL:** https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816
**Category:** Development
**Created:** [July 9, 2018, 7:32pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816 "2018-07-09T19:32:30Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 9, 2018, 7:32pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/1 "2018-07-09T19:32:30Z")

</div>

The Device ID doesn’t say anything, why should we not use the distributed DNS system (with own DNS servers) to have a discosrv coupled with the strength of internet caching. I had an idea

- TXT record

- Server/NAS record

- User instance on a system could become: [jerry@nas.xor-gate.org](mailto:jerry@nas.xor-gate.org) resolves uses the record:

This is just a idea with rough edges to share with you all.

- Edit: There seems to be already DNS-SD (service discovery) [https://en.wikipedia.org/wiki/Zero-configuration\_networking#DNS-based\_service\_discovery](https://en.wikipedia.org/wiki/Zero-configuration_networking#DNS-based_service_discovery)

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [July 9, 2018, 8:43pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/2 "2018-07-09T20:43:03Z")

</div>

I’m not sure I understand the point? This is a way of discovering the device ID for someone associated with a domain, so someone can bombard you with “Accept this device” requests? However they won’t know any of your folder IDs, so it’s not enough to actually share anything?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 9, 2018, 9:20pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/3 "2018-07-09T21:20:44Z")

</div>

What if you’re behind corporate DNS servers that do not answer to TXT queries?

The value add here is that you don’t need to memorise IDs? How often do you need to add a device? You could just have a TXT record you can dig whenever you forget it that returns you the ID.

---

<div class="post-metadata">

### Author: ![schnappi](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@schnappi](https://forum.syncthing.net/u/schnappi)
#### Post date: [July 9, 2018, 9:27pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/4 "2018-07-09T21:27:50Z")

</div>

This is a neat idea. Suspect complicated to implement but really good idea on individual basis.

Had device ID’s in a spreadsheet but this may be better way to store.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 9, 2018, 9:32pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/5 "2018-07-09T21:32:09Z")

</div>

How many users actually have the capability to create txt records?

The idea itself is not bad, but it’s probably easier to add some sort of name aliasing and a sense of ownership into the vanilla discovery than to ask people to use DNS.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 9, 2018, 9:42pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/6 "2018-07-09T21:42:06Z")

</div>

@AudriusButkevicius I totaly agree on your points. I have seen public internet in a train which won’t relay any SSHFP records. Syncthing is great, it should not become a “dropbox” replacement but current user-base are mostly tech people. Security and user-friendlyness are choices but I like the idea just to use an easy to remember alias (e.g name@domain) with my Device ID. This can also be implemented in a more advanced discovery with trusted/signed chains of key-values with the device id public part of the cert (e.g DHT).

It is indeed true people can DDOS on your syncthing instance because brute force on aliases (e.g with a domain) is easier than DDOS on the list of all possible device ids.

---

<div class="post-metadata">

### Author: ![schnappi](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@schnappi](https://forum.syncthing.net/u/schnappi)
#### Post date: [July 9, 2018, 10:01pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/7 "2018-07-09T22:01:38Z")

</div>

Regardless of feasibility or useability give credit for innovative use of txt records.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 9, 2018, 10:31pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/8 "2018-07-09T22:31:06Z")

</div>

Something similar was proposed before, albeit different and more advanced, using SRV or even A records and DNSSEC for signing/verifying advertisements etc.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 10, 2018, 6:52am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/9 "2018-07-10T06:52:16Z")

</div>

The only thing I can find on the forum is this post of you @AudriusButkevicius [Future protocol & discovery changes](https://forum.syncthing.net/t/future-protocol-discovery-changes/1385/2)

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 10, 2018, 7:15am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/10 "2018-07-10T07:15:13Z")

</div>

It was in the old syncthing/discovery repo.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 13, 2018, 8:22am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/11 "2018-07-13T08:22:59Z")

</div>

You could punch through corporate firewalls DNS over HTTPS (or DNS over TLS) which is fairly new concept: [https://en.wikipedia.org/wiki/DNS\_over\_HTTPS](https://en.wikipedia.org/wiki/DNS_over_HTTPS).

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 13, 2018, 8:25am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/12 "2018-07-13T08:25:00Z")

</div>

So you had actual DNS server code in place? I was playing around with [CoreDNS](https://coredns.io/) which seems fairly nice with a pluggable (compile-type) DNS system.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 13, 2018, 10:18am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/13 "2018-07-13T10:18:34Z")

</div>

I had a thing written using miekg/dns, but I hit fragmentation issues, but that was for a different problem. Dns over https is essentially what we have now, just our addresses are device ids.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [July 14, 2018, 10:13am UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/14 "2018-07-14T10:13:31Z")

</div>

I could see a point in being able to add a device as either device ID or address (DNS or IP). If an address was entered you’d get to confirm/accept the device ID on first connect. Potentially in that case a TXT or SRV record could point out the correct device ID and you could skip the confirmation step.

---

<div class="post-metadata">

### Author: ![xor-gate](https://forum.syncthing.net/user_avatar/forum.syncthing.net/xor-gate/32/2934_2.png) [@xor-gate](https://forum.syncthing.net/u/xor-gate)
#### Post date: [July 14, 2018, 9:30pm UTC](https://forum.syncthing.net/t/distribution-of-device-id-using-dns-txt-record/11816/15 "2018-07-14T21:30:46Z")

</div>

In the case you want to add devices based on their “(pseudo)mail adres” we should hash with salt e.g {SSHA256} to prevent pushing semi-private information in public registries like DNS. Just like ssh known\_hosts is able to be hashed for leaking hostnames.
