<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" consensus="true"
     category="std" docName="draft-ietf-dnssd-advertising-proxy-07" ipr="trust200902"
     obsoletes="" updates="" submissionType="IETF" xml:lang="en"
     tocInclude="true" tocDepth="3" symRefs="true" sortRefs="false">

  <front>
    <title abbrev="Advertising Proxy for DNS-SD SRP">Advertising Proxy for DNS-SD Service Registration Protocol</title>

    <author initials="S." surname="Cheshire" fullname="Stuart Cheshire">
      <organization>Apple Inc.</organization>
      <address>
        <postal>
          <street>One Apple Park Way</street>
          <city>Cupertino</city>
          <region>California</region>
          <code>95014</code>
          <country>United States of America</country>
        </postal>
        <phone>+1 (408) 996-1010</phone>
        <email>cheshire@apple.com</email>
      </address>
    </author>

    <author initials="T." surname="Lemon" fullname="Ted Lemon">
      <organization>Apple Inc.</organization>
      <address>
        <postal>
          <street>One Apple Park Way</street>
          <city>Cupertino</city>
          <region>California</region>
          <code>95014</code>
          <country>United States of America</country>
        </postal>
        <phone>+1 (408) 996-1010</phone>
        <email>elemon@apple.com</email>
      </address>
    </author>

    <author initials="E." surname="Dijk" fullname="Esko Dijk">
      <organization>IoTconsultancy.nl</organization>
      <address>
	<postal>
	  <city>Utrecht</city>
	  <country>Netherlands</country>
	</postal>
	<email>esko.dijk@iotconsultancy.nl</email>
      </address>
    </author>

    <date year="2026" month="November" day='16'/>

    <area>INT</area>
    <workgroup>DNSSD</workgroup>

    <keyword>Multicast DNS</keyword>
    <keyword>DNS-Based Service Discovery</keyword>

    <abstract>
      <t>An Advertising Proxy advertises the contents of a DNS zone, for example maintained
      using the DNS-SD Service Registration Protocol (SRP), using Multicast DNS. This allows
      legacy clients to discover services registered with SRP using Multicast DNS.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://dnssd-wg.github.io/draft-ietf-dnssd-advertising-proxy/draft-ietf-dnssd-advertising-proxy.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-dnssd-advertising-proxy/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        DNSSD Working Group mailing list (<eref target="mailto:dnssd@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/dnssd/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/dnssd/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/dnssd-wg/draft-ietf-dnssd-advertising-proxy"/>.</t>
    </note>
  </front>

  <middle>
    <section numbered="true">
      <name>Introduction</name>
      <t>
	DNS-Based Service Discovery (DNS-SD)
	<xref target="RFC6763"/>
	<xref target="I-D.cheshire-dnssd-roadmap"/>
	was designed to facilitate Zero Configuration IP Networking
	<xref target="RFC6760"/>
	<xref target="ZC"/>.

	When used with Multicast DNS (mDNS)
	<xref target="RFC6762"/>
	with ".local" domain names
	<xref target="RFC6761"/>
	this works well on a single link (a single broadcast domain).
      </t>

      <t>However, in some applications, multicast may be a poor choice for advertising services. Most
      obviously, Multicast DNS is constrained to a single network link, and for example in the
      case of stub networks <xref target="I-D.ietf-snac-simple"/>, service discovery
      for devices on the stub network by devices on the infrastructure network, or vice versa,
      requires some kind of proxy.</t>

      <t>Also, even in single-link use cases, multicast isn't always the best choice. On some
      network media, multicast is inefficient and/or unreliable. Also, mDNS-based DNS-SD requires
      that each host providing services receive and process all mDNS service discovery messages,
      whether or not they are relevant to that host (for example, irrelevant service
      advertisements and queries for services not provided by the host). For energy-constrained
      hosts, keeping a radio listening all the time for these messages is prohibitively expensive.</t>

      <t>Ideally, in situations where Multicast DNS is not the right choice, an obvious
      alternative is to use regular unicast DNS <xref target="RFC1035"/>. Unfortunately, this
      isn't always possible: the DNS protocol relies on a delegation hierarchy, and on
      per-network DNS resolvers.</t>

      <t> The operational model for DNS service is that the infrastructure serving each network
      link provides a DNS resolver, and all DNS queries go to that resolver. Using unicast
      DNS for discovery of services through a stub network proxy, for example, would require
      that the stub network proxy be able to somehow register with the infrastructure DNS
      service. No standard mechanism for doing this currently exists.</t>

      <t>This document describes a new type of proxy, an Advertising Proxy, which can be used to
      address some of these issues.  An Advertising Proxy advertises the contents of some DNS
      zone (or zones) <xref target="RFC1034"/> to one or more network links using multicast
      DNS. This allows the DNS protocol, for example using the Service Registration Protocol (SRP)
      registrar function <xref target="RFC9665"/>, to be used by servers to
      advertise their services, while using the permissionless model of Multicast DNS to make those
      services discoverable to devices on links supported by the Advertising Proxy.</t>

      <t>The operation of an Advertising Proxy is limited by the fact that the DNS zone is a single dataset, while
      the set of names discoverable with mDNS is constructed cooperatively, so the Advertising Proxy
      is not authoritative in the same sense that a DNS server is authoritative for any
      particular zone. This means that in some cases a name that is present in the DNS zone may
      conflict with a name already published by some other mDNS responder.</t>

      <section numbered="true">
	<name>Conventions and Terminology Used in This Document</name>
        <t>
          The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
          "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
          NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
          "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
          "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are
          to be interpreted as
          described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/>
          when, and only when, they appear in all capitals, as shown here.
        </t>
        <t>
          The DNS/mDNS/DNS-SD/SRP terminology from <xref target="RFC1034"/>, <xref target="RFC2181"/>,
          <xref target="RFC6762"/>, <xref target="RFC6763"/> and <xref target="RFC9665"/> is used in this document.
        </t>
        <t>'dataset' is defined in <xref target="sec-dns-dataset"/>.</t>
      </section>
      <section>
	<name>Glossary</name>
	<dl>
	  <dt>Advertised Zone</dt>
	  <dd>A zone that is being advertised over mDNS by an Advertising Proxy.</dd>
	  <dt>Owner Name</dt>
	  <dd>The domain name on which some DNS RR is discoverable. For example, a host with
	  an IP address of 2001:db8::1 might have an AAAA record on the name 'host.local'.
	  In this case, 'host.local' is the owner name of this AAAA record. See
	  <xref target="RFC1035" section="3.2.1" sectionFormat="of"/>.</dd>
	</dl>
      </section>
    </section>

    <section numbered="true">
      <name>Advertising Proxy</name>
      <t>
	The Advertising Proxy works by publishing records from a DNS zone using Multicast DNS
	<xref target="RFC6762"/>. The set of records published may include every record in the
	DNS zone, or a subset determined either automatically or administratively. When a record
	published in the DNS zone has the same name as a record published by some device that is
	not the Advertising Proxy, this will produce a conflict, and the Advertising Proxy must
	address this conflict.
      </t>
      <t>
	Although we will in some cases refer to aspects of the mDNS protocol in this document,
	it is worth emphasizing that the typical implementer of an Advertising Proxy should not
	expect to have to do their own mDNS implementation: most platforms already provide a
	library that allows records and/or services to be published using mDNS. So our goal in
	discussing mDNS protocol details is to motivate choices that the implementer will make
	in their use of these libraries.
      </t>
      <t>
	The simplest implementation of an Advertising Proxy will simply act on some signal
	indicating that the DNS zone has been updated. When this signal is received, the
	Advertising Proxy will terminate whatever mDNS advertisements it is currently doing, and
	then iterate across the set of names in the zone, publishing all of the RRsets on each
	name in the DNS.
      </t>
      <t>
	Of course, this simple approach to an Advertising Proxy has some issues. Multicast
	traffic on some link types (e.g., IEEE 802.11) consumes substantially more airtime than
	unicast traffic, so efforts should be made to minimize such traffic where
	possible. Also, the act of unpublishing an advertised record can be seen by consumers of
	the information in that record as an indication that whatever host or service that
	record represents is no longer present.
      </t>
      <t>
	For these reasons, it is better if the Advertising Proxy can notice changes to the DNS
	zone, and only remove records from mDNS when they have been removed from the zone. New
	records in the zone will be newly advertised, of course, just as with the previous
	approach.
      </t>
      <section>
	<name>Mapping non-'.local.' domain names to '.local.'</name>
	<t>
	  Multicast DNS supports advertising of arbitrary names. However, the mechanism by which
	  names in the DNS hierarchy are found is DNS, not mDNS, with one exception: names
	  ending in '.local.'. Consequently, we can't simply publish names using mDNS with the
	  same name that they have in the DNS hierarchy, because queries for those names will
	  use DNS rather than mDNS.
	</t>
	<t>
	  But what does it mean to rewrite a name?
	</t>
	<section anchor="sec-dns-dataset">
	  <name>The DNS Dataset</name>
	  <t>
	    DNS has the concept of a "zone," which is a subset of the domain name hierarchy over
	    which some DNS server or servers assert authority. That authority is confirmed because
	    a name server that is authoritative for a zone higher in the domain name hierarchy
	    publishes a delegation naming the DNS server or servers that are authoritative for
	    the subdomain.
	  </t>
	  <t>
	    As an example, the root ('.') zone has a set of authoritative servers that advertise
	    it, and contains delegations for "top-level domains" like 'com.'. 'com.' is also a
	    zone.  However, it is not necessarily the case that a zone exists at only one level of
	    the DNS hierarchy. A zone can include more than one level. For example, consider the
	    reverse zone 'ip6.arpa.'. Here the subdomain will generally cover at least an IPv6
	    64-bit prefix.
	  </t>
	  <t>
	    So if we consider an IPv6 prefix '2001:db8:1234:5678::/64', the reverse zone for this
	    will likely be '8.7.6.5.4.3.2.1.8.b.d.0.1.0.0.2.ip6.arpa.'. There will most likely
	    be 16 more labels below the zone cut that are still part of the zone.
	  </t>
	  <t>
	    For the DNS Service Discovery use case, this pattern&mdash;a zone including more than one
	    level&mdash;is quite common. A service instance name in mDNS
	    will typically look something like 'servicename._example._udp.&lt;domain&gt;.' A hostname on the
	    other hand will look like 'hostname.&lt;domain&gt;.' So we need to distinguish between the
	    name of the zone in which a name is advertised, the set of subdomains that actually represent
	    additional domains in which names can be advertised, and subdomains that are part of the structure
	    of the name.
	  </t>
	  <t>
	    For this reason, rather than speaking of DNS zones here, it would be more accurate to use another
	    term that represents the &lt;domain&gt; part of the names above. We will use the term 'dataset' here,
	    since this term is also used in the SRP Replication document <xref target="I-D.ietf-dnssd-srp-replication"/>.
	  </t>
	  <t>
	    This means that an Advertising Proxy acts as a proxy for one or more datasets,
	    rather than one or more zones. Which datasets the Advertising Proxy advertises with
	    mDNS will either be determined automatically, or explicitly configured.  It's
	    entirely possible for the Advertising Proxy to act as a proxy for 'example.com.' and
	    'foo.example.com.'. Both 'example.com' and 'foo.example.com' are dataset names in this
	    example.
	  </t>
	</section>
	<section>
	  <name>How to rewrite names</name>
	  <t>
	    Before advertising a DNS record, the Advertising Proxy MUST rewrite the record. This means that
	    both the owner name of the record and any domain names embedded in the record's RDATA must be
	    rewritten if they are subdomains of the domain name of the dataset. Of course the owner
	    name will always be a subdomain of the dataset name, but this won't always be true for
	    names within the RDATA (if any).
	  </t>
	  <t>
	    It can also make sense specifically for a PTR record to do a different rewrite for the owner
	    name than for the target name of the PTR record, depending on the way that we choose to rewrite
	    the names. There are three ways that we can rewrite names, depending on the context:
	  </t>
	  <ol>
	    <li>
	      <t>
		Rewrite the dataset name directly to '.local.'. This has the benefit of
		simplicity.  When the data for which the Advertising Proxy is acting as proxy
		is DNS-SD data, for any service that is being advertised, there will be a set
		of PTR records of the form '_example._transport.&lt;domain&gt;.'.  If we
		rewrite &lt;domain&gt; to 'local', then a browse for the service
		'_example._transport' in the local domain will return the services being
		advertised.
	      </t>
	      <t>
		The downside to this approach is that it doesn't safely handle name
		conflicts: if there are two datasets for which one or more Advertising
		Proxies are acting as proxy, and each dataset contains a device with the name
		'george', then this will produce a conflict that can't easily be resolved:
		the name is necessarily unique in each dataset, but when the two datasets
		are both mapped into the '.local.' namespace, they are in conflict. There
		is no way to resolve this.
	      </t>
	      <t>
		Consider an RR that might appear in a dataset with a domain name of 'default.service.arpa.':
		'_example._transport.default.service.arpa. IN PTR instname._example._transport.default.service.arpa.'.
		This would be rewritten to '_example._transport.local. IN PTR instname._example._transport.local.'.
              </t>

	    </li>
	    <li>
	      <t>
		Use a dataset-specific subdomain of '.local.' for each dataset. For example,
		when we are maintaining the dataset using SRP, this SRP dataset will have a
		unique identifier, which we can in principle use here. So the domain into
		which we would rewrite the records from this dataset would then take the
		binary dataset ID and probably encode it as hexadecimal, producing
		'&lt;dataset-id&gt;.local.' as the target domain.
	      </t>
	      <t>
		There is a problem with this approach however: devices browsing for services in
		'.local.' will not know to also browse in this subdomain of '.local.'. In order
		to fix this, the owner names of the PTR records being advertised will have to be
		rewritten into the '.local.' domain rather than '&lt;dataset-id&gt;.local.'.
		This is perfectly okay, however, since these PTR records are not required to
		be unique.
	      </t>
	      <t>
		If the domain being proxied has PTR records that are not being used to
		advertise services, and all PTR records are rewritten into the '.local.'
		domain, this could be a problem. However, since the primary use case for the
		Advertising Proxy is DNS Service Discovery, and additionally since PTR records
		generally are only used for service discovery and reverse lookups, it should
		be safe to rewrite PTR records to '.local.' for datasets that are not reverse
		lookup zones. Reverse lookups are already documented in <xref target="RFC6762"/>
		and should not generally require an Advertising Proxy.
	      </t>
	      <t>
		As an example of the PTR rewrite, if the dataset identifier is 5c4d2e9ab4 and
		the dataset domain name is default.service.arpa, the record
		'_example._transport.default.service.arpa. IN PTR instname._example._transport.default.service.arpa.'
		would be rewritten to
		'_example._transport.local. IN PTR instname._example._transport.5c4d2e9ab4.local.'.
	      </t>
	    </li>
	    <li>
	      <t>
		Append '.local.' to the dataset's domain name. For cases where there is no unique
		dataset identifier, the dataset's domain name can be used instead.
		The reason not to do this is simply that it results in a longer
		name, and could theoretically violate domain name length limits.
		The rewrite here would be from, e.g., 'hostname.default.service.arpa.' to
		'hostname.default.service.arpa.local.'.
	      </t>
	      <t>
		As with the dataset-specific subdomain of '.local.', the owner name for
		PTR records should be rewritten directly into '.local.'. So for example,
		the service advertisement in the earlier example, assuming a dataset domain
		name of 'default.service.arpa.', would be rewritten from
		'_example._transport.default.service.arpa. IN PTR instname._example._transport.default.service.arpa.'
		to '_example._transport.local. IN PTR instname._example._transport.default.service.arpa.local.'.
              </t>
	    </li>
	  </ol>
	</section>
  </section>
<section>
  <name>Handling of IP address records that are not global in scope</name>
  <t>
    In some cases, an SRP requester may register one or more IP address records for
    addresses that aren't valid or reachable on some link on which the Advertising Proxy
    could advertise them. The Advertising Proxy function MAY filter out such address records
    entirely, or MAY explicitly advertise such records only on the link(s) on which they are
    reachable. This is optional because it requires the Advertising Proxy function to have
    enough information to make such a determination, which may not always be the case.
  </t>
  <t>
    Filtering such addresses when possible is particularly beneficial for link-local addresses,
    since there is no way to determine, using the list of on-link prefixes or routes, that the
    address is not locally reachable. Howwever, when reachable, link-local addresses are
    generally preferable because they can be assumed to be the most stable addresses. So
    correct handling of such addresses can prevent delays.
  </t>
  <t>
    In order for any such filtering to be possible, it is necessary that the mechanism whereby
    addresses are added to the putative DNS zone or zones that the advertising proxy is advertising
    identify the link on which the address is valid. How specifically this identification occurs is
    out of scope for this document.
  </t>
  <t>
    Where such determinations are possible, the Advertising Proxy MUST NOT advertise an
    IPv4 or IPv6 link-local address, or any other media-specific link-scoped address, on any
    link other than the link on which it is valid.
  </t>
  <t>
    When a link-scoped IP address is present in the zone, and other addresses of wider scope
    are also available, and the advertising proxy does not know on which link the link-scoped
    address is valid, the advetising proxy MUST NOT advertise that address. However, when that
    address is the only alternative, it MUST advertise the address.
  </t>
  <t>
    When the address is global in scope, the advertising proxy MAY, when able, determine whether
    or not the address might work on a particular link by using its routing table and its
    knowledge of on-link prefixes as a guide. This determination can be done as described in
    <xref target="RFC6724"/> as modified by <xref target="I-D.ietf-6man-rfc6724-update"/>.
    If there is no valid pair of source and destinationa ddress that would work on the link,
    then the advertising proxy MUST NOT advertise that address.
  </t>
  <t>
    It is possible that none of the addresses in the set of address RRs in the zone being
    advertised for a specific name are valid on a particular link. In this case, the advertising
    proxy MAY advertise the entire RRset.
  </t>
  <t>
    It could be observed that a host might be connected to two links A and B, such that addresses
    discovered via mDNS on link A might not work on link A, but might work on link B. However,
    mDNS is link-specific. The validity of addresses on other links a host may be connected to
    is out of scope for mDNS. Therefore, supporting this configuration is out of scope for
    advertising proxies.
  </t>
</section>
<section>
  <name>Conflicts and Stale Data</name>
  <t>
    There are two issues that can come up when advertising a dataset using mDNS that
    appear quite similar on the surface, but are actually fairly different. These both
    show up as a "conflict," but in fact only one is actually a conflict.
  </t>
  <t>
    To prevent stale data winning over updated data, an Advertising Proxy MUST support the Time
    Since Received (TSR) EDNS0 option described in <xref target="I-D.ietf-dnssd-tsr"/>. This
    should mean that different advertising proxies advertising RRs on behalf of entities for
    which TSR is applicable will treat data that would otherwise be seen as conflicting
    according to the TSR specification, and hence such data will not be treated as a name
    conflict.
  </t>
  <t>
    In the case that an entire DNS zone is controlled by a single entity, that entity should
    provide a key tag (and possibly a key) to identify itself, and the "time since received"
    should be derived based on the time that the zone was updated. This can be done e.g.
    by treating the zone serial number as a date, for normal DNS zones.
  </t>
  <t>
    A conflict occurs when two different devices assert authority for the same
    name. However, stale data can also appear as a conflict, even though there is only one
    device asserting authority for the data.  The problem of stale data occurs when there is
    more than one Advertising Proxy replicating and advertising the same dataset.
  </t>
  <t>
    mDNS specifies that conflicts should be resolved by renaming. Instead of continuing to
    try to claim the name that is in conflict, the Advertising Proxy MAY rename following the
    mDNS renaming method. In this case, the mapping between the new name and the name as it
    appears in the dataset must be maintained until such time as the conflict no longer
    exists. So this approach requires maintaining some state.
  </t>
  <t>
    How this should be resolved depends on the exact circumstances. The advertising proxy is
    a general-purpose specification, but also has particular uses. How the domain being
    advertised is maintained therefore has a significant impact on how this problem should
    be solved.
  </t>
  <section anchor="managed-zones">
    <name>Managed Zone</name>
    <t>
      In the case of a managed zone being replicated via an advertising proxy, there is no
      practical way we can specify to deal with conflicts. The contents of the zone are
      specified by the administrator, but the contents of the mDNS are unmanaged. A conflict in
      this case could have many meanigns and many resolutions. An advertising proxy in such a
      configuration SHOULD, where possible, have a way, either through logging or a user
      interface, to notify the administrator of the conflict. The administrator is expected
      to determine the resolution of the conflict.
    </t>
    <t>
      In the case of a managed zone, in the case of DNSSD, and possibly other cases, there can
      be a remedy available that is not available in other use cases. Presumably the DNS zone
      being advertised is also a DNS zone that can be queried via DNS. If that's the case,
      the advertising proxy can simply not rewrite domains pointed to by RRs in the zone.
    </t>
    <t>
      In this case, for example, the PTR query to browse services can simply point to the
      DNS, and the rest of the discovery query can then be satisfied through DNS rather than
      mDNS queries. In this case, the behavior required in <xref target="consistency"/> is
      no longer necessary because all pointers into the zone are pointers into the DNS zone
      and not into mDNS, and so mDNS conflicts are not a problem.
    </t>
    <t>
      If this approach is used, then it's actually not even necessary to publish the names
      at the target. An advertising proxy MAY identify pointed-to records and not translate
      or publish them using mDNS.
    </t>
  </section>
  <section>
    <name>Autonomously Maintained Infrastructure Zone</name>
    <t>
      If the advertising proxy is running on an infrastructure device (e.g. a CE Router
      <xref target="RFC7084"/>, then the SRP zone should be discoverable using DNS lookups.
      In this case, the behavior described in <xref target="managed-zones"/> will work and
      is RECOMMENDED. In general, doing service discovery using DNS instead of mDNS is
      more effecitient, faster, and more reliable, so where possible this approach is
      better than discovering everything over mDNS, even in cases where some mDNS discovery
      is necessary.
    </t>
    <t>
      Infrastructure advertising proxies MAY use the same techniques described in
      <xref target="ad-hoc"/>. This is less efficient, but can be appropriate, for example
      in the case where there is more than one infrastructure CE router, and hence DNS
      cannot be assumed to work for all hosts on the link, and also for cases where the
      implementation is shared between infrastructure use cases and ad-hoc use cases,
      and only supports the latter.
    </t>
  </section>
  <section anchor="ad-hoc">
    <name>Ad-hoc Zones Maintained using SRP</name>
    <t>
      In the case of a zone maintained by SRP, how the advertising proxy behaves when a conflict
      is detected is ideally controlled by the SRP client. If the SRP client indicates that
      it doesn't care about mDNS name conflicts, then the advertising proxy can do renaming
      itself. If the SRP client cares, then the record that got the mDNS conflict can be
      removed from the zone maintained by SRP, the client can be notified, and it can choose
      a new name.
    </t>
    <t>
      If the client is not taking responsibility for renaming, then the advertising proxy MUST
      choose a new owner name to replace the owner name of the RRs that got the name conflict
      in mDNS. In this case, the advertising proxy MUST also update any RRs that point to
      that name.
    </t>
    <t>
      When renaming, the advertising proxy MUST allocate a subdomain of .local in which to
      advertise the new name. It SHOULD maintain exactly one such subdomain per advertised
      zone. The subdomain name is claimed by choosing a name and advertising an SOA record on
      that name using mDNS. If no name conflict occurs when advertising this SOA record, the
      name is used, otherwise the advertising proxy chooses a new name until it is successful.
    </t>
    <t>
      Once a .local subdomain is allocated, the advertising proxy advertises the name that
      got the conflict in the subdomain. Such domains will also be discovered using mDNS, but
      since the advertising proxy has claimed the subdomain, it should be safe to advertise
      records under it, and they should never get name conflicts.
    </t>
    <t>
      In the case that a name conflict happens when advertising the name in the claimed zone,
      the advertising proxy MUST fall back to mDNS renaming as described in
      <xref target="RFC6762" section="9" sectionFormat="of"/>.
    </t>
  </section>
</section>
<section anchor="consistency">
  <name>Data Consistency in the Presence of Conflicts</name>
  <t>
    It can be the case that a record for which there would be no mDNS conflict points to a name
    in an advertised zone for which a name conflict exists. In such a situation, a name that is
    provided under the authority of the zone points to a name that is provided by some other
    authority. This can be a simple mistake, but also creates an opportunity for an attack.
    Note that this section applies <em>only</em> to cases of name conflicts, and <em>not</em> to
    cases of stale data.
  </t>
  <t>
    The advertising proxy is expected to prevent situations where a name that refers to one
    entity accidentally or intentionally winds up pointing to a name that refers to a different
    entity, to the extent possible. There are some cases where this may not be possible.
    One example is an RRtype that was either defined after the advertising proxy implementation
    was done, or of which the implementor was not aware. Another example is an RR like the TXT
    record, which can in principle contain one or more domain names, but which has no
    formal semantics that specifies that it points to one or more domain names.
  </t>
  <t>
    There are three combinations of owner name and resource record that need to be considered
    here:
  </t>
  <dl>
    <dt>Type A:</dt>
    <dd>Owner names for which publication of a record produced a name conflict</dd>
    <dt>Type B:</dt>
    <dd>Owner names for which one or more RRs point to another owner name of Type A</dd>
    <dt>Type C:</dt>
    <dd>
      Owner names for which one or more RRs point to another owner name of Type B or Type
      C.</dd>
  </dl>
  <t>
    For the purposes of this section, a name of type A, B or C is referred to as an "affected
    name."  When an advertising proxy detects that an RR it is publishing points to an affected
    name, it MUST stop publishing that RR. When an advertising proxy would normally begin to
    publish such an RR, it MUST NOT do so.
  </t>
  <t>
    The advertising proxy may have other records to publish on the same owner name. For such
    records, if it knows that they refer to the same entity, it SHOULD NOT publish those
    records. The reason not to publish them is twofold: first, to avoid a situation where the
    consumer of the record winds up in an unexpected state because it discovers one record but
    not another, and secondly to avoid sending useless multicast traffic.
  </t>
  <t>
    However, advertising proxies are not required to have such knowledge for any particular
    use case. If the advertising proxy does not know that such a relationship exists, it MUST
    publish such records.
  </t>
  <t>
    One of the primary current use cases for advertising proxies is DNSSD, so advertising
    proxies MUST understand the semantic relationship between DNSSD records, specifically
    the SRV and PTR records.
  </t>
  <t>
    To illustrate the problem, consider a DNS-SD service advertisement for a printer service.
    The service instance name might be 'laser-printer._ipp._tcp.local'. The service instance
    will typically be the owner name of two records: an SRV and a TXT record.
  </t>
  <t>
    The SRV record has another domain name as its target hostname. This target name in most
    cases will appear in the same zone as the service instance name. So here it might be
    'printer.local'. Suppose that when the advertising proxy advertises an AAAA record for
    printer.local, it gets a name conflict.
  </t>
  <t>
    In this situation, the SRV record is now pointing to some host _other_ than the printer.
    This other host might be another printer, or it could easily be an attacker attempting to
    capture print jobs. In order to prevent this, the advertising proxy does not publish the SRV
    record. An advertising proxy that is aware of DNSSD semantics also does not publish the TXT
    record, because it is on the affected name and is related.
  </t>
  <t>
    But remember that a DNSSD service advertisement consists of a PTR record on the service name
    ('_ipp._tcp.local') pointing to the service instance name. If more than one service of the
    same type is advertised, there will be one PTR record per such service. These PTR records
    all have the same owner name, but are referring to distinct services.
  </t>
  <t>
    Whether an advertising proxy is aware of DNSSD semantics or not, it will not publish the PTR
    record pointing to 'laser-printer._ipp._tcp.local' because it is a record pointing to an
    affected name. However, if the advertising proxy did not understand the semantics of DNSSD
    and removed all other PTR records because they're in the same RRset on the same owner name,
    this would needlessly break discovery for all other printers. This is the reason for saying
    that if the semantics are not understood, the advertising proxy MUST continue to publish the
    records that don't point to an affected name.
  </t>
  <t>
    For the case of TXT records, which have no formal semantic regarding pointers to domain
    names, it is possible that an advertising proxy implementation may understand the semantics
    for a specific use of the TXT record for a specific service type. In such cases, if the
    TXT record in fact contains a pointer to an affected name, it should be handled like any
    other RR that contains a pointer to an affected name.
  </t>
</section>
<section>
  <name>Multiple advertisers</name>
  <t>
    mDNS responders in general are expected to be able to provide redundant service. There are
    several existing documented use cases. Unicast Local Discovery <xref target="I-D.ietf-dnssd-uld"/>
    and SRP Replication <xref target="I-D.ietf-dnssd-srp-replication"/> are two of these.
    Coordination between Multicast DNS Responders <xref target="I-D.ietf-dnssd-tsr"/> extends the
    mDNS protocol to better support these use cases. Advertising proxies MUST implement this
    specification.
  </t>
</section>
<section>
  <name>Advertising Key Record</name>
  <t>
    It's possible in the case of an SRP dataset that a name might be reserved using a KEY lease, but
    no other records published on that name. In such cases, the advertising proxy MUST defend the name
    in mDNS so that it's not taken by some other device. To do this, it MUST advertise the KEY record.
    It is not necessary that this key record contain the client's actual key. However, since the
    TSR record contains a KEY tag, the key is not revealing anything new. The advertising proxy
    MAY advertise a smaller KEY record to hold the name, or MAY advertise the actual KEY record that
    the client provided.
  </t>
  <t>
    If there are other RRs on a name, the key record is not necessary to defend the name. Whether
    the advertising proxy includes the KEY record in this case is an implementation choice. Since there
    is no privacy issue, the main reason to include it is to keep the implementation simple, and the
    main reason to exclude it is to reduce multicast traffic.
  </t>
</section>
<section>
  <name>TTL values</name>
  <t>
    The mDNS specification says that address records should be advertised with a TTL of 120 seconds,
    and other records with a TTL of 75 minutes. This can produce a pattern where a long-lived query
    monitoring address records produces a lot of mDNS traffic. For this reason, we suggest using a
    TTL of 75 minutes in all cases.
  </t>
</section>
<section numbered="true">
      <name>No Text-Encoding Translations</name>

      <t>
        Similar to a Discovery Proxy
        <xref target="RFC8766"/>,
        an Advertising Proxy does no translation between
        text encodings
        <xref target="RFC6055"/>.
        Specifically, an Advertising Proxy does no
        translation between Punycode encoding
        <xref target="RFC3492"/>
        and UTF-8 encoding
        <xref target="RFC3629"/>,
        either in the owner name of DNS records or
        anywhere in the RDATA of DNS records
        (such as the RDATA of PTR records, SRV records, NS
        records, or other record types like TXT, where it is
        ambiguous whether the RDATA may contain DNS names).
        All bytes are treated as-is with no attempt at
        text-encoding translation.
        A server implementing DNS-based Service Discovery
        <xref target="RFC6763"/>
        will use UTF-8 encoding for its unicast DNS-based
        record registrations, which the Advertising Proxy
        passes through without any text-encoding
        translation to the Multicast DNS subsystem.
        Queries from peers on the configured multicast-capable
        interface are answered directly from the advertised data
        without any text-encoding translation.
      </t>
</section>

<section numbered="true">
      <name>No Support for Reconfirm</name>
      <t>
        For network efficiency,
        Multicast DNS
        <xref target="RFC6762"/>
        uses fairly long record lifetimes
        (typically 75 minutes).
        When a client is unable to reach
        a service that it discovered,
        Multicast DNS provides a "reconfirm"
        mechanism that enables the client
        to signal to the Multicast DNS subsystem
        that its cached data may be suspect,
        which causes the Multicast DNS subsystem
        to reissue queries, and remove the stale
        records if the queries are not answered.
      </t>
      <t>
        Similarly, when using unicast service discovery
        with a Discovery Proxy <xref target="RFC8766"/>,
        the DNS Push Notifications <xref target="RFC8765"/> protocol
        provides the RECONFIRM mechanism to signal that
        the Discovery Proxy should perform a local
        Multicast DNS reconfirm operation to
        re-verify the validity of the records.
      </t>
      <t>
        When an Advertising Proxy is used,
        to support legacy clients that only implement Multicast DNS,
        reconfirm operations have no effect.

        If a device uses unicast Service Registration Protocol
        <xref target="RFC9665"/>
        to register its services
        with a service registry with both SRP registrar and Advertising Proxy functions,
        and the device then gets disconnected from the network,
        the Advertising Proxy will continue to advertise
        those records until the service registrations expire.

        If a client discovers the service instance using
        Multicast DNS and is unable to reach it,
        and uses a Multicast DNS reconfirm operation to re-verify
        the validity of the records, then
        the Advertising Proxy will continue
        to answer on behalf of the departed device
        until the service registrations expire.

        The Advertising Proxy has no reliable way
        to determine whether the additional Multicast DNS
        queries are due to a reconfirm operation,
        or due to other routine causes,
        like a client being rebooted,
        or a client disconnecting and then reconnecting to the network.

        The service registry has no reliable automatic way
        to determine whether a device that
        registered records has meanwhile failed or disconnected from the network.
        Particularly with services provided by sleepy battery-powered devices,
        the service registry does not know what active duty cycle
        any given service is expected to provide.
      </t>
      <t>
        Consequently, reconfirm operations are not supported
        with an Advertising Proxy using Multicast DNS.
        In cases where use of the reconfirm mechanism
        is important, clients should be upgraded to use the unicast
        DNS Push Notifications <xref target="RFC8765"/> protocol's
        RECONFIRM message.
        This RECONFIRM message provides an unambiguous signal
        to the service registry that it may be retaining stale records.
        (A future update to the Service Registration Protocol
        <xref target="RFC9665"/>
        could consider ways that this unambiguous signal
        can be used to trigger expedited removal of stale data.)
      </t>
</section>
    </section>
    <section numbered="true">
      <name>Security Considerations</name>
      <t>An Advertising Proxy can make DNS records visible
      to eavesdroppers on the configured multicast-capable link(s) on which it advertises using mDNS.</t>
    </section>
    <section numbered="true">
      <name>IANA Considerations</name>
      <t>This document has no IANA actions.</t>
    </section>

  </middle>

  <back>
    <displayreference target="I-D.cheshire-dnssd-roadmap" to="ROADMAP"/>
    <displayreference target="I-D.ietf-dnssd-srp-replication" to="REPLICATION"/>
    <displayreference target="I-D.ietf-snac-simple" to="STUBNET"/>
    <displayreference target="I-D.ietf-dnssd-tsr" to="TSR"/>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1034.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2181.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6761.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6762.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6763.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8765.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9665.xml"/>

        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6724.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-6man-rfc6724-update.xml"/>

        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dnssd-tsr.xml"/>
      </references>

      <references>
        <name>Informative References</name>

        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3492.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3629.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6055.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6760.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8766.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7084.xml"/>

        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.cheshire-dnssd-roadmap.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dnssd-srp-replication.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-snac-simple.xml"/>
        <xi:include
            href="https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dnssd-uld.xml"/>


        <reference anchor="ZC">
          <front>
            <title>Zero Configuration Networking: The Definitive Guide</title>
            <seriesInfo name="ISBN" value="0-596-10100-7"/>
            <author initials="S." surname="Cheshire"
		    fullname="Stuart Cheshire"/>
            <author initials="D. H." surname="Steinberg"
		    fullname="Daniel H. Steinberg"/>
            <date year="2005" month="December"/>
          </front>
          <refcontent>O'Reilly Media, Inc.</refcontent>
        </reference>

      </references>
    </references>

    <!--
	<section numbered="false">
	<name>Acknowledgments</name>
	<t>Thanks to <contact fullname="A Person"/>.</t>
	</section>
    -->

  </back>
</rfc>
