Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

appc: use TXT dns records for discovery #242

Closed

Description

@philips

@blalor said "I feel like there should be a DNS component to this, as well. Perhaps a TXT record?" in #210.

Lets discuss that topic here.

/cc @geekgonecrazy

Activity

  1. geekgonecrazy commented on Dec 8, 2014

    @geekgonecrazy

    For me there are a few reasons for a DNS record.

    • I prefer to keep un-needed tags out of my website markup.
    • I compile my website / web app. So my sites markup is actually in a docker container currently and versioned. So i'd have to bake it in there.
    • I can update my DNS via a REST api.
    • Already partially using DNS for service discovery.
    • Running internal DNS for intranet. Could keep info completely private with out having to maintain 2 versions of my site, or have to use a different domain.
  2. blalor commented on Dec 8, 2014

    @blalor

    All of those things. Said far better than I could do it. :-)

  3. philips commented on Dec 8, 2014

    @philips
    ContributorAuthor

    @geekgonecrazy @blalor Can you provide some example TXT record formats to consider for this? I don't have a good first-hand experience with the constraints or features of the format.

  4. robszumski commented on Dec 8, 2014

    @robszumski
    Contributor

    TXT record would also mean you're not spinning up extra infrastructure just to serve a few meta tags on a certain domain.

  5. geekgonecrazy commented on Dec 8, 2014

    @geekgonecrazy

    I'm in no way qualified to give a definitive answer. But here's what my google-fu gives me.

    From RFC1464

    The general syntax is:
    
            <owner> <class> <ttl> TXT "<attribute name>=<attribute value>"
    

    From reading the App container spec i'd guess something like this:

    ac-discovery content="prefix-match url-tmpl"
    ac-discovery-pubkeys content="prefix-match url"

    or

    ac-discovery="prefix-match url-tmpl"
    ac-discovery-pubkeys="prefix-match url"

    Records could be separate or in the same record. If i'm not mistaken you're limited to 255 characters.

    If you wanted to squeeze them all in the same record could do:

    app-container discovery="prefix-match url-tmpl" discovery-pubkeys="prefix-match url"

  6. philips commented on Dec 8, 2014

    @philips
    ContributorAuthor

    @miekg You are a DNS expert, any suggestions on resources to help us design a TXT record format. Essentially we want to have the same thing as these HTTP meta tags only for TXT records:

    https://github.com/coreos/rocket/blob/master/app-container/SPEC.md#meta-discovery

    Any help would be greatly appreciated.

  7. geekgonecrazy commented on Dec 8, 2014

    @geekgonecrazy

    Just realized i'm using " inside the example records. Looks like they'd have to be escaped which would be messy. So would have to break it up a bit.

    ac-discovery:
    example.com. 730 IN TXT "ac-discovery prefix=example.com url-tmpl=https://example.com/{os}/{arch}/{name}-{version}.{ext}?torrent"

    ac-discovery-pubkeys:
    example.com. 730 IN TXT "ac-discovery-pubkeys prefix=example.com url=https://example.com/pubkeys.gpg"

    But yeah a DNS expert would know.

  8. miekg commented on Dec 8, 2014

    @miekg

    Just pulled in, haven't read the spec. This is all new, so a client needs to understand the records? If so, don't, DON'T use a TXT record, invent a new type (it's easy and the best thing to do - I can help). You can copy the TXT semantics but they are not great. If you only need two elements, just define the new RR to do so.

  9. geekgonecrazy commented on Dec 8, 2014

    @geekgonecrazy

    don't, DON'T use a TXT record, invent a new type (it's easy and the best thing to do - I can help)

    @miekg Correct me if i'm wrong.. But wouldn't this require us to be running our own DNS servers so that we could then add this new type in?

    If so, that'd defeat the usefulness of using a DNS record, right?

  10. miekg commented on Dec 8, 2014

    @miekg

    Not per se, as all dns servers should support unknown records (but yes some
    don't support those)
    On 8 Dec 2014 22:42, "Aaron Ogle" [email protected] wrote:

    don't, DON'T use a TXT record, invent a new type (it's easy and the
    best thing to do - I can help)

    @miekg https://github.com/miekg Correct me if i'm wrong.. But wouldn't
    this require us to be running our own DNS servers so that we could then add
    this new type in?

    If so kinda defeats the usefulness of using a DNS record, right?

    —
    Reply to this email directly or view it on GitHub
    #242 (comment).

  11. geekgonecrazy commented on Dec 8, 2014

    @geekgonecrazy

    If this is to be added to part of the App Container spec i'd think we would want to only use established DNS records. So that it could be used regardless of the DNS server used.

    I don't think i've personally ever seen one that would allow you to feed an unknown record type. Other then maybe a bind9 server. Definitely not something like Amazon's Route 53 or any other DNS service.

  12. blalor commented on Dec 8, 2014

    @blalor

    Yeah, that's why I suggested TXT: universality. Unless there's another suitable record type. IANADNSE. (I am not a DNS expert)

  13. miekg commented on Dec 9, 2014

    @miekg

    Also see http://miek.nl/posts/2013/Oct/12/What%20to%20put%20in%20the%20DNS/

    TXT can work, but when requesting the record you can all TXT records under that name, so maybe it is prudent to use a special sub domain? Also just put base64 data in the record if you're scared of encoding issues (which will be plenty full). Just make sure that you split the fragments on the 255 per-text limit boundery.

    I will check the spec and send a longer reply this evening (GMT)

  14. miekg commented on Dec 9, 2014

    @miekg

    Yes you can use underscores in names. What 255 limit? You can store 16k in
    a txt record.
    On 9 Dec 2014 11:41, "Brian Lalor" [email protected] wrote:

    I do think an ACI-specific subdomain for the TXT record would be fine; the
    record would not have to be a resolvable name (ie one with A or CNAME
    records). I don’t know how trustworthy this source is, but it does state
    that an underscore can be used with TXT subdomains:
    http://domainkeys.sourceforge.net/underscore.html <
    http://domainkeys.sourceforge.net/underscore.html>

    So you could have a single _ac.example.com http://ac.example.com/
    record, or multiples to support future keys without hitting the 255 byte
    limit. Say _discovery._ac.example.com http://ac.example.com/ and
    _discovery-pubkeys._ac.example.com http://ac.example.com/.=

    —
    Reply to this email directly or view it on GitHub
    #242 (comment).

  15. blalor commented on Dec 9, 2014

    @blalor

    On Dec 9, 2014, at 6:53 AM, Miek Gieben [email protected] wrote:

    Yes you can use underscores in names. What 255 limit? You can store 16k in a txt record.

    Ah, I thought someone else said that was the limit. Why not just an _ac-discovery.example.com http://ac-discovery.example.com/ with a JSON blob?=

  16. miekg commented on Dec 9, 2014

    @miekg

    That can work, but do note that due to the silliness of the txt record,
    this needs to be split in 255 bytes chunks.

    Still think a new RR makes most sense, but that can be a parallel effort.
    On 9 Dec 2014 11:55, "Brian Lalor" [email protected] wrote:

    On Dec 9, 2014, at 6:53 AM, Miek Gieben [email protected] wrote:

    Yes you can use underscores in names. What 255 limit? You can store 16k
    in a txt record.

    Ah, I thought someone else said that was the limit. Why not just an _
    ac-discovery.example.com http://ac-discovery.example.com/ with a JSON
    blob?=

    —
    Reply to this email directly or view it on GitHub
    #242 (comment).

  17. blalor commented on Dec 9, 2014

    @blalor

    Ok, and that would be the 255 byte limit…=

  18. miekg commented on Dec 9, 2014

    @miekg

    You can store 16 k but each segment in a txt can only hold 255 bytes
    because it is preceded by a one byte length. There can be multiple segments
    in a single Txt record.

    Txt records are complete crap.
    On 9 Dec 2014 12:37, "Brian Lalor" [email protected] wrote:

    Ok, and that would be the 255 byte limit…=

    —
    Reply to this email directly or view it on GitHub
    #242 (comment).

  19. geekgonecrazy commented on Dec 9, 2014

    @geekgonecrazy

    Why all the need for encoding or json? Seems like we might be overcomplicating things. Should be super simple.

    ac-discovery

    TXT record with subdomain _ac-discovery
    With value: "prefix=example.com url-tmpl=https://example.com/{os}/{arch}/{name}-{version}.{ext}?torrent"

    _ac-discovery.example.com. 1800 IN  TXT "prefix=example.com url-tmpl=https://example.com/{os}/{arch}/{name}-{version}.{ext}?torrent"
    _ac-discovery.example.com. 1800 IN  TXT "prefix=example2.com url-tmpl=https://example.com/{os}/{arch}/{name}-{version}.{ext}?torrent"
    

    ac-discovery-pubkeys

    TXT record with subdomain _ac-discovery-pubkeys
    With value: "prefix=example.com url=https://example.com/pubkeys.gpg"

    _ac-discovery-pubkeys.example.com. 1800 IN TXT  "prefix=example.com url=https://example.com/pubkeys.gpg"
    

    Very similar to the meta tags, very easy to write, very easy to parse.

    Grab txt records for subdomain _ac-discovery parse the records returned. With TXT you can do multiple records for that same subdomain same as with meta tags.

  20. philips commented on Dec 9, 2014

    @philips
    ContributorAuthor

    This issue was moved to appc/spec#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions