Difference between revisions of "Bering-uClibc 4.x - User Guide - Advanced Topics - Setting Up Zeroconf Networking"
Davidmbrooke (Talk | contribs) (Added initial DNS-SD content) |
Davidmbrooke (Talk | contribs) m |
||
Line 69: | Line 69: | ||
====Service Pointers==== | ====Service Pointers==== | ||
− | The main "glue" in the DNS-SD configuration is another <tt>PTR</tt> record which enumerates the Services by service Type | + | The main "glue" in the DNS-SD configuration is another <tt>PTR</tt> record which enumerates the Services by service Type. |
The <code class="filename">/etc/dnsmasq.conf</code> syntax for this is: | The <code class="filename">/etc/dnsmasq.conf</code> syntax for this is: | ||
ptr-record=_http._tcp.private.network,Bering-uClibc Webconf._http._tcp.private.network | ptr-record=_http._tcp.private.network,Bering-uClibc Webconf._http._tcp.private.network |
Revision as of 16:40, 21 November 2010
Advanced Topics - Setting Up Zeroconf Networking | ||
---|---|---|
Prev | Bering-uClibc 4.x - User Guide |
Introduction
Zero Configuration Networking (or Zeroconf) refers to a set of standards for automatically configuring IP networks and for advertising services available to a particular domain. Further information is available from the main Zeroconf web site.
This topic can be confusing because a lot of different names are used to refer to the same or similar things:
- Bonjour, previously known as Rendezvous, is Apple's implementation of Zeroconf.
- Avahi is an alternative implementation of Zeroconf for Linux and BSD.
- mDNS or Multicast DNS is one of the technologies used for Zeroconf.
- DNS-SD or DNS Service Discovery is another of the technologies used for Zeroconf.
Implementing DNS-SD using Dnsmasq
DNS-SD (DNS Service Discovery) is a way of using a standard DNS server to advertise services which are available on a particular LAN or DNS domain.
Dnsmasq, the DNS server used for Bering-uClibc 4.x can be configured to advertise such services.
While the necessary configuration changes are relatively minor (just a few lines in /etc/dnsmasq.conf
the syntax is somewhat cryptic. Most of the examples elsewhere on the Internet are for alternative DNS servers (mainly BIND) rather than Dnsmasq.
Configuring Static DNS-SD
The simplest case of DNS-SD is configuring Dnsmasq to advertise the details for services available on the local LAN. A DNS-SD client sends a number of standard DNS queries to the DNS server specified in its DHCP lease, so by configuring that DNS server (Dnsmasq) we can arrange for a list of services to be advertised.
In this example we advertise the Webconf HTTP service running on the Bering-uClibc 4.x machine itself but it must be emphasized that a service running anywhere on the local network can be advertised instead (or as well).
Service Definition
The first step is to define the service which will be advertised. The service definition is not actually specific to DNS-SD but a DNS SRV record as defined in RFC 2782 is required as the "target" of the DNS-SD configuration.
In summary, the service definition consists of a SRV record which specifies:
- The service Name, e.g. "Bering-uClibc Webconf"
- The service Type, e.g. HTTP (actually specified as "_http")
- The service Protocol, e.g. TCP (actually specified as "_tcp")
- The service Host, e.g. "firewall.private.network"
- The service Port on that Host, e.g. "80"
- The service Priority (optional)
- The service Weight (optional)
In addition to the SRV record there is a TXT record with additional information. In this example it is just the path component of the HTTP URL. The content of the TXT record varies considerably for different service Types.
The /etc/dnsmasq.conf
syntax for this is:
srv-host=Bering-uClibc Webconf._http._tcp.private.network,firewall.private.network,80 txt-record=Bering-uClibc Webconf._http._tcp.private.network,"path=/"
If multiple host machines offer the same service there can be repeated srv-host lines, with the same service Name but different service Host values.
Refer to the comments in /etc/dnsmasq.conf
for details of the Priority and Weight syntax if you need to specify these.
Now for the actual DNS-SD configuration.
Domain Enumeration
A DNS-SD client asks for a list of domains to Browse for service advertisements by sending a PTR query for b._dns-sd._udp.private.network. In principle we could specify a completely different domain to browse (such as example.com) but it is customary to specify the "same" domain, private.network.
The /etc/dnsmasq.conf
syntax for this is:
ptr-record=b._dns-sd._udp.private.network,private.network
Additional similar lines could be added if required.
Default Browse Domain
In the case that multiple Browse domains are specified the DNS-SD client needs to know which one to pick as the default. This is achieved by specifying a Default Browse domain.
The /etc/dnsmasq.conf
syntax for this is:
ptr-record=db._dns-sd._udp.private.network,private.network
This is optional if only a single Browse domain is specified.
Legacy Browse Domain
For maximum compatibility, also specify a single domain that Legacy DNS-SD clients should Browse for services.
The /etc/dnsmasq.conf
syntax for this is:
ptr-record=lb._dns-sd._udp.private.network,private.network
Service Pointers
The main "glue" in the DNS-SD configuration is another PTR record which enumerates the Services by service Type.
The /etc/dnsmasq.conf
syntax for this is:
ptr-record=_http._tcp.private.network,Bering-uClibc Webconf._http._tcp.private.network
Additional similar lines can be added if required.
Service Types List
While not required for normal DNS-SD operation, a DNS-SD client sometimes wants to query for a list of all the service Types available on the domain.
It does this by sending a PTR query for _services._dns-sd._udp.private.network.
The /etc/dnsmasq.conf
syntax for this is:
ptr-record=_services._dns-sd._udp.private.network,_http._tcp.
Note that this correctly omits the private.network suffix, as per the standard. Additional similar lines can be added if further service types are available.
Configuring Dynamic DNS-SD
TODO
- Register domain list: PTR r._dns-sd._udp.private.network
- Default Register domain: PTR dr._dns-sd._udp.private.network
Implementing mDNS
TODO Is this relevant for Bering-uClibc? Should we develop an Avahi package?
Further Reading
- "Zero Configuration Networking: The Definitive Guide" by Daniel Steinberg and Stuart Cheshire, published by O'Reilly Media.
Prev | Up |