#readwise
# Zero-Configuration Networking - Wikipedia

## Metadata
- Author: [[wikipedia.org]]
- Full Title: Zero-Configuration Networking - Wikipedia
- URL: https://en.wikipedia.org/wiki/Zero-configuration_networking
## Summary
The text discusses zero-configuration networking protocols like mDNS and DNS-SD used for automatic network setup and service discovery. These protocols help devices communicate without manual IP configurations. They allow for easy discovery of services on a network through domain names and service types.
## Highlights
**Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable [computer network](https://en.wikipedia.org/wiki/Computer_network) based on the [[Internet Protocol Suite - Wikipedia|Internet Protocol Suite]] (TCP/IP) when computers or network peripherals are interconnected. It does not require manual operator intervention or special configuration servers. Without zeroconf, a network administrator must set up [network services](https://en.wikipedia.org/wiki/Network_service), such as [[Dynamic Host Configuration Protocol - Wikipedia|Dynamic Host Configuration Protocol]] (DHCP) and [Domain Name System](https://en.wikipedia.org/wiki/Domain_Name_System) (DNS), or configure each computer's network settings manually.**
**Zeroconf is built on three core technologies: automatic assignment of numeric [network addresses](https://en.wikipedia.org/wiki/Network_address) for networked devices, automatic distribution and resolution of computer [hostnames](https://en.wikipedia.org/wiki/Hostname), and automatic [location of network services](https://en.wikipedia.org/wiki/Service_discovery), such as printing devices.** ([View Highlight](https://read.readwise.io/read/01hy2zjkwfdbs27te32epeba5v))
---
Most IPv4 hosts use link-local addressing only as a last resort when a DHCP server is unavailable. An IPv4 host otherwise uses its DHCP-assigned address for all communications, global or link-local. One reason is that IPv4 hosts are not required to support multiple addresses per interface, although many do. Another is that not every IPv4 host implements distributed name resolution (e.g., [[Multicast DNS - Wikipedia|multicast DNS]]), so discovering the autoconfigured link-local address of another host on the network can be difficult. Discovering the DHCP-assigned address of another host requires either distributed name resolution or a unicast DNS server with this information; some networks feature DNS servers that are automatically updated with DHCP-assigned host and address information. ([View Highlight](https://read.readwise.io/read/01hy2zp00rbzqb5k7g5yewnzkf))
---
Both IPv4 and IPv6 hosts may randomly generate the host-specific part of an autoconfigured address. IPv6 hosts generally combine a prefix of up to 64 bits with a 64-bit EUI-64 derived from the factory-assigned 48-bit [IEEE](https://en.wikipedia.org/wiki/IEEE) [MAC address](https://en.wikipedia.org/wiki/MAC_address). The MAC address has the advantage of being globally unique, a basic property of the EUI-64. The IPv6 protocol stack also includes duplicate address detection to avoid conflicts with other hosts. In IPv4, the method is called *link-local address autoconfiguration*. However, [Microsoft](https://en.wikipedia.org/wiki/Microsoft) refers to this as *[Automatic Private IP Addressing](https://en.wikipedia.org/wiki/Automatic_Private_IP_Addressing)* (APIPA) or *Internet Protocol Automatic Configuration* (IPAC). ([View Highlight](https://read.readwise.io/read/01hy2zpyczcm69jsp1bj2rw784))
---
In 2000, Bill Manning and [Bill Woodcock](https://en.wikipedia.org/wiki/Bill_Woodcock) described the *Multicast Domain Name Service*, which spawned the implementations by Apple and Microsoft. Both implementations are very similar. Apple's [[Multicast DNS - Wikipedia|Multicast DNS]](mDNS) is published as a standards track proposal [RFC 6762](https://datatracker.ietf.org/doc/html/rfc6762), while Microsoft's [Link-local Multicast Name Resolution](https://en.wikipedia.org/wiki/Link-local_Multicast_Name_Resolution) (LLMNR) is published as informational [RFC 4795](https://datatracker.ietf.org/doc/html/rfc4795). LLMNR is included in every Windows version from Windows Vista onwards and acts as a side-by-side alternative for Microsoft's NetBIOS Name Service over IPv4 and as a replacement over IPv6, since NetBIOS is not available over IPv6. Apple's implementation is available as the [Bonjour service](https://en.wikipedia.org/wiki/Bonjour_(software)) since 2002 in Mac OS X v10.2. The Bonjour implementation (mDNSResponder) is available under the [Apache 2 Open Source License](https://en.wikipedia.org/wiki/Apache_License) and is included in [Android Jelly Bean](https://en.wikipedia.org/wiki/Android_Jelly_Bean) and later under the same license. ([View Highlight](https://read.readwise.io/read/01hy2zwq3t2ap401d97knh1jxz))
---
The mDNS and LLMNR protocols have minor differences in their approach to name resolution. mDNS allows a network device to choose a domain name in the [local](https://en.wikipedia.org/wiki/.local) DNS [namespace](https://en.wikipedia.org/wiki/Namespace) and announce it using a special multicast IP address. This introduces special semantics for the [top-level domain](https://en.wikipedia.org/wiki/Top-level_domain_name) *local*, which is considered a problem by some members of the IETF. The current LLMNR draft allows a network device to choose any domain name, which is considered a security risk by some members of the IETF. mDNS is compatible with DNS-SD as described in the next section, while LLMNR is not. ([View Highlight](https://read.readwise.io/read/01hy2zzvna198jvxgvetj1ymyv))
---
**DNS-SD (DNS Service Discovery) allows clients to discover a named list of service instances and to resolve those services to hostnames using standard DNS queries. The specification is compatible with existing unicast DNS server and client software, but works equally well with mDNS in a zero-configuration environment.** Each service instance is described using a DNS [SRV](https://en.wikipedia.org/wiki/SRV_record) and DNS [TXT](https://en.wikipedia.org/wiki/TXT_record) record. A client discovers the list of available instances for a given service type by querying the DNS PTR record of that service type's name; the server returns zero or more names of the form `<Service>.<Domain>`, each corresponding to a SRV/TXT record pair. The [SRV record](https://en.wikipedia.org/wiki/SRV_record) resolves to the domain name providing the instance, while the TXT can contain service-specific configuration parameters. A client can then resolve the A/AAAA record for the domain name and connect to the service. ([View Highlight](https://read.readwise.io/read/01hyd220krqnk7rcvzectsnb7f))
---
Service types are given on a first-come-first-serve basis. A service type registry was originally maintained by DNS-SD.org, but has since been merged into IANA's registry for DNS SRV records. ([View Highlight](https://read.readwise.io/read/01hyd220krqnk7rcvzectsnb7f))
---
**mDNS uses packets similar to [unicast DNS](https://en.wikipedia.org/wiki/Domain_Name_System#DNS_message_format) to resolve hostnames except they are sent over a multicast link.** Each host listens on the mDNS port, 5353, transmitted to a well-known multicast address and resolves requests for the [DNS record](https://en.wikipedia.org/wiki/Resource_record) of its *.local* hostname (e.g. the [A](https://en.wikipedia.org/wiki/List_of_DNS_record_types#A), [AAAA](https://en.wikipedia.org/wiki/List_of_DNS_record_types#AAAA), [CNAME](https://en.wikipedia.org/wiki/CNAME_record)) to its IP address.
**When an mDNS client needs to resolve a local hostname to an IP address, it sends a DNS request for that name to the well-known multicast address; the computer with the corresponding A/AAAA record replies with its IP address.** The mDNS multicast address is *224.0.0.251* for IPv4 and *ff02::fb* for IPv6 link-local addressing.
DNS Service Discovery aka [DNS-SD](https://en.wikipedia.org/wiki/DNS-SD) requests can also be sent using mDNS to yield zero-configuration DNS-SD. This uses DNS [PTR](https://en.wikipedia.org/wiki/PTR_record), SRV, [TXT](https://en.wikipedia.org/wiki/TXT_record) records to advertise instances of service types, domain names for those instances, and optional configuration parameters for connecting to those instances. But SRV records can now resolve to *.local* domain names, which mDNS can resolve to local IP addresses. ([View Highlight](https://read.readwise.io/read/01hyd24n2d5kxvks8629yc9tmb))
---