[Feature Request] Nextcloud servers and clients should support Zeroconf (a.k.a. "Bonjour")

Feature Proposal: Zeroconf

Nextcloud servers and clients should support ā€œZeroconfā€, the technology concept which crystallized as and is layed down in the DNS-SD/rfc6763 (DNS Service Discovery) and mDNS/rfc6762 (Multicast DNS) documents published by the Internet Engineering Task Force (IETF).

Zeroconf-/Avahi-/Bonjour-enabled devices and clients could then be able to auto-discover all Nextcloud services in their neighbourhood which are willing to share something. Nextcloud servers would announce their services by the same means.


Nextcloud Zeroconf Use Cases

  1. Kurt wants to offer a mini-ownNextCloud server which is open for his housemates, all visitors and everybody who is in reach of his WLAN. He wants them to be able to auto-discover his ownNextCloud service and connect to it without them needing to ask for an IP address. His visitors just come and start their Nextcloud clients to discover kurtsCloud.

  2. Jos is on a conference hopping trip around the world giving talks and demos. At the start of the ā€œlive demoā€ part of his presentation about the newest and coolest, yet unreleased features of Nextcloud, he just plugs in a Raspberry Pi 3 with Nextcloud installed. Then he asks his audience to start their Nextcloud clients to auto-discover his Raspbi-driven Nextcloud instance and they can easily connect to it without knowing more.

  3. Niels is on a business trip to demonstrate a new hardware product with built-in Nextcloud server support to potential customers. Most of his audience have Nextcloud clients installed on their iOS and Android mobiles already, because he had suggested this to them beforehand. After starting their Nextcloud clients they can immediately ā€œseeā€ the hardwareā€™s Nextcloud server instance (which is already switched on) and can connect to its Nextcloud server with a single click.

  4. Frank looks for a new job and is invited for an interview. While waiting in the companyā€™s HQ lobby for his HR contact person to turn up, he (of course) plays with his tablet and has his Nextcloud client open. To his surprise he discovers that the prospect employer runs a Nextcloud instance sharing interesting documents and videos which all visitors and prospective new employees can easily see.

  5. Olivier sits at an airport lobby and wants to connect to the Nextcloud server run by his company from his iPad. From an email two days ago he vaguely remembers that the hostname and IP address had to be changed due to an upgrade, but he forgot the details. However, he remembered that it had mentioned something like: ā€œadd our domain name to ā€˜search domainā€™ and it will work with your mobile clientsā€. So he goes to ā€œSettings -> WLANā€ and simply adds mycompany.com into the ā€˜Search Domainā€™ field. His Nextcloud iOS client can now easily find and connect to the new Nextcloud server even though his DHCP-delivered IP address and current domain from the airport hotspot belongs to T-mobileā€¦ (The same is true for Olivierā€™s Safari browser on his MacBook.)

(Preliminary end of user stories ā€“ sorry, no gender proportionality so far.)


Zeroconf Technology Usage Elsewhere

In the last 10 years DNS-SD/mDNS-based Zeroconf support has experienced a wide adoption across all fields of IT technology. I wonder why ownCloud has not yet made use of it:

  • If you are not yet familiar with DNS-SD and mDNS: this is what Apple uses in its technology marketed as ā€œBonjourā€.
  • This is what CUPS uses for seamless sharing of (shared) printers, which lets all CUPS clients ā€œjust printā€ without needing to install a ā€œdriverā€ā€¦
  • This is what Appleā€™s AirPrint technology uses behind the scenes to achieve seamless printing from iOS devices to all AirPrint-enabled printersā€¦
  • This is what Appleā€™s AirPlay uses for sharing iTunes musicā€¦
  • This is what Kodi uses to become an AirPlay target and let Windows, Linux and Mac clients stream AirPlay content to a Kodi instanceā€¦
  • This is whatā€™s behind Avahi on Linux to support Bonjour-like functionality on our preferred OS platformā€¦
  • There are numerous examples now to be found in real life around you ā€“ too numerous to list them allā€¦

(BTW, Wide-Area Zeroconf is also supported: your DNS Admin just needs to insert a few service resource records (RR) into the DNS serverā€™s zone file for all Zeroconf-aware clients to discover the services offered. You can see how this works if you simply add dns-sd.org as a ā€œbrowse domainā€ into the DNS configuration dialog of your iPad or iPhone. The dns-sd.org domainā€™s DNS server will announce a few (fake) services for anybody who is interested to test his DNS-SD client code:

The respective clients will then be able to see a few (fake) services, like ā€œStuartā€™s Home AirPrint Printerā€ or ā€œStuartā€™s Cubeā€ in their environment.)

Thatā€™s what the ownCloud snap is using, but it isnā€™t working very well and the URL is not recognized by browsers.

This comment expands on my feature request from above and gives you and your developers a few hints about where to start.

Discover currently available Zeroconf-enabled services

You can easily discover all currently available Zeroconf-enabled services in your neighbourhood. For this, command-line tools as well as GUI apps are available.

Command line tools

Here are a few command line examples which will let you discover DNS-SD/mDNS service announcements travel through the network which you currently are connected to:

Using the standard command line tool dig

You can use the following commands on any platform which supports dig.

Host name resolution without central DNS server:

Simply resolve IP addresses for hostnames you happen to know ā€“ but without knowing the central DNS serverā€™s IP address (or while the DNS server is not available) ā€“ by using an mDNS query:

  $ dig -p 5353 @224.0.0.251 hostname.local.

mDNS is using port 5353 and the multicast address 224.0.0.251 for its queries and its announcements, which are, with about 99% match, just standard DNS packets.

The last commands could return the following output:

  ; <<>> DiG 9.8.3-P1 <<>> -p 5353 @224.0.0.251 hostname.local.
  ; (1 server found)
  ;; global options: +cmd
  ;; Got answer:
  ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28705
  ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

  ;; QUESTION SECTION:
  ;hostname.local.		IN	A
  
  ;; ANSWER SECTION:
  hostname.local.	10	IN	A	192.168.177.24
  
  ;; Query time: 78 msec
  ;; SERVER: 192.168.177.24#5353(224.0.0.251)
  ;; WHEN: Thu Jun  9 10:51:34 2016
  ;; MSG SIZE  rcvd: 50

Or, asking for a less verbose output:

  $ dig +nocmd -p 5353 @224.0.0.251 hostname.local. +noall +answer

  hostname.local.	600	IN	A	192.168.177.24

Service Discovery on Remote Domain

Asking for info about all (fake) services which the (remote) domain dns-sd.org has on offer:

 $ dig +nocmd -t PTR _services._dns-sd._udp.dns-sd.org. +noall +answer
    
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_afpovertcp._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_pdl-datastream._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_ftp._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_ipp._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_ssh._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_http._tcp.dns-sd.org.
    _services._dns-sd._udp.dns-sd.org. 59 IN PTR	_printer._tcp.dns-sd.org.

They offer Apple File Sharing (indicated by _afpovertcp) as well as Printing via JetDirect/Port9100 (indicated by _pdl-datastream), File Transfer Protocol (_ftp), Internet Printing Protocol (_ipp), Secure Shell (_ssh), a Web Server (_http) and a legacy Port 515 LPR/LPD Printer (_printer).

AirPrint Printer Discovery for Remote Domain

Enumerate all AirPrint printers available at (remote) domain dns-sd.org:

 $ dig +nocmd -t ANY _universal._sub._ipp._tcp.dns-sd.org. +noall +answer
   
    _universal._sub._ipp._tcp.dns-sd.org. 59 IN PTR Stuart's\032Home\032AirPrint\032Printer._ipp._tcp.dns-sd.org.

IPP Printer Discovery for Remote Domain

Enumerate all IPP printers (includes, of course, AirPrint printers) at dns-sd.org:

 $ dig +nocmd -t ANY _ipp._tcp.dns-sd.org. +noall +answer
    
    _ipp._tcp.dns-sd.org.   59  IN  PTR Sales._ipp._tcp.dns-sd.org.
    _ipp._tcp.dns-sd.org.   59  IN  PTR Marketing._ipp._tcp.dns-sd.org.
    _ipp._tcp.dns-sd.org.   59  IN  PTR Engineering._ipp._tcp.dns-sd.org.
    _ipp._tcp.dns-sd.org.   59  IN  PTR 3rd\.\032Floor\032Copy\032Room._ipp._tcp.dns-sd.org.
    _ipp._tcp.dns-sd.org.   59  IN  PTR Stuart's\032Home\032AirPrint\032Printer._ipp._tcp.dns-sd.org.

Using the dns-sd command

The following commands work only on a Mac (or any platform, including Windows and Linux, where you have self-compiled Appleā€™s open source Bonjour SDK).

General Service Discovery on Local Network

Check for all types of services which are available to my notebook in my current network environment:

 $ dns-sd  -B _services._dns-sd._udp  local.

 Browsing for _services._dns-sd._udp.local.
 DATE: ---Thu 09 Jun 2016---
 11:45:23.751  ...STARTING...
 Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ssh
 11:45:23.752  Add        3   4 .                    _tcp.local.          _sftp-ssh
 11:45:23.752  Add        3   4 .                    _tcp.local.          _atc
 11:45:23.752  Add        3   4 .                    _tcp.local.          _daap
 11:45:23.752  Add        3   4 .                    _tcp.local.          _smb
 11:45:23.752  Add        3   4 .                    _tcp.local.          _googlecast
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ipp
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ipps
 11:45:23.752  Add        3   4 .                    _tcp.local.          _afpovertcp
 11:45:23.752  Add        3   4 .                    _tcp.local.          _testlargetxt
 11:45:23.752  Add        3   4 local.               _apple-mobdev2._tcp. _sub
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ipp
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ipps
 11:45:23.752  Add        3   4 .                    _tcp.local.          _testtxt
 11:45:23.752  Add        3   4 .                    _tcp.local.          _testdualtxt
 11:45:23.752  Add        3   4 .                    _udp.local.          _net-assistant
 11:45:23.752  Add        3   4 .                    _tcp.local.          _nomachine
 11:45:23.752  Add        3   4 .                    _tcp.local.          _http
 11:45:23.752  Add        3   4 .                    _tcp.local.          _ipp
 11:45:23.752  Add        3   4 .                    _tcp.local.          _rfb
 11:45:23.752  Add        3   4 .                    _tcp.local.          _raop
 11:45:23.752  Add        3   4 .                    _tcp.local.          _apple-mobdev2
 11:45:23.752  Add        3   4 .                    _tcp.local.          _airplay
 11:45:23.752  Add        3   4 .                    _tcp.local.          _workstation
 11:45:23.752  Add        3   4 .                    _tcp.local.          _eppc
 11:45:23.752  Add        3   4 .                    _tcp.local.          _testupdate
 11:45:23.752  Add        3   4 .                    _tcp.local.          _udisks-ssh
 11:45:23.752  Add        2   4 .                    _tcp.local.          _amzn-wplay
 ^C

Amazing, isnā€™t it ?!?

All these other notebooks, workstations, IoT devices, iPhones, iPads and Android phones and tablets in my neighbourhood seem to be sharing their info about services available for them rather liberallyā€¦ (But disappointing: no ownCloud or Nextcloud in sightā€¦)

IPP Printer Discovery on Remote Domain

Searching for all IPP-enabled printers in domain dns-sd.org (using -B for ā€œbrowseā€):

 $ dns-sd  -B _ipp._tcp  dns-sd.org.
    
    Browsing for _ipp._tcp.dns-sd.org.
    DATE: ---Tue 17 May 2016---
    17:40:30.998  ...STARTING...
    Timestamp     A/R  Flags  if Domain        Service Type  Instance Name
    17:40:30.998  Add      3   0 dns-sd.org.   _ipp._tcp.    Stuart's Home AirPrint Printer
    17:40:30.998  Add      3   0 dns-sd.org.   _ipp._tcp.    Sales
    17:40:30.998  Add      3   0 dns-sd.org.   _ipp._tcp.    Marketing
    17:40:30.998  Add      3   0 dns-sd.org.   _ipp._tcp.    Engineering
    17:40:30.998  Add      2   0 dns-sd.org.   _ipp._tcp.    3rd. Floor Copy Room
    ^C

Look up and retrieve all info about a specific service instance which was previously discovered (using -L for ā€œlookupā€:

 $ dns-sd  -L "Stuart's Home AirPrint Printer"  _ipp._tcp  dns-sd.org.

    Lookup Stuart's Home AirPrint Printer._ipp._tcp.dns-sd.org.
    DATE: ---Tue 17 May 2016---
    17:45:22.284  ...STARTING...
    17:45:22.737  Stuart's\032Home\032AirPrint\032Printer._ipp._tcp.dns-sd.org. can be reached at airprint.dns-sd.org.:631 (interface 0)
     txtvers=1 qtotal=1 pdl=application/postscript,application/vnd.hp-PCL,application/vnd.hp-PCLXL,application/pdf,image/urf rp=ipp/printer \
      URF=CP99,W8,OB10,PQ3-4-5,ADOBERGB24,DEVRGB24,DEVW8,SRGB24,IS1-2-4,MT1-2-3-5-12,MT1-2-3-5-12,RS600 ty=HP\ LaserJet\ 400\ color\ M451nw \
      Color=T Duplex=F Scan=F product=\(HP\ LaserJet\ 400\ color\ M451nw\) priority=10 adminurl=http://www.dns-sd.org/ServerStaticSetup.html \
      note=At\ Stuart\'s\ house
    ^C

Using the avahi-browse command line tool

The following commands should work on any Linux system with Avahi packages installed.

Browse for all locally available services of all types

This will give a similar result as the previously shown command dns-sd -B _services._dns-sd._udp local. for Mac OS X:

 $ avahi-browse _services._dns-sd._udp. -t

 + wlan1 IPv4 _amzn-wplay                        _tcp                 local
 + wlan1 IPv4 _sftp-ssh                          _tcp                 local
 + wlan1 IPv4 _atc                               _tcp                 local
 + wlan1 IPv4 _daap                              _tcp                 local
 + wlan1 IPv4 _ssh                               _tcp                 local
 + wlan1 IPv4 _apple-mobdev2                     _tcp                 local
 + wlan1 IPv4 _udisks-ssh                        _tcp                 local
 + wlan1 IPv4 _testupdate                        _tcp                 local
 + wlan1 IPv4 _eppc                              _tcp                 local
 + wlan1 IPv4 _airplay                           _tcp                 local
 + wlan1 IPv4 _raop                              _tcp                 local
 + wlan1 IPv4 _rfb                               _tcp                 local
 + wlan1 IPv4 _ipp                               _tcp                 bonjour.muada.nl
 + wlan1 IPv4 _http                              _tcp                 local
 + wlan1 IPv4 _nomachine                         _tcp                 local
 + wlan1 IPv4 _net-assistant                     _udp                 local
 + wlan1 IPv4 _testdualtxt                       _tcp                 local
 + wlan1 IPv4 _testtxt                           _tcp                 local
 + wlan1 IPv4 _ipps                              _tcp                 bonjour.muada.nl
 + wlan1 IPv4 _ipp                               _tcp                 local
 + wlan1 IPv4 _sub                               _apple-mobdev2._tcp  local
 + wlan1 IPv4 _testlargetxt                      _tcp                 local
 + wlan1 IPv4 _afpovertcp                        _tcp                 local
 + wlan1 IPv4 _ipps                              _tcp                 local
 + wlan1 IPv4 _ipp                               _tcp                 dns-sd.org
 + wlan1 IPv4 _googlecast                        _tcp                 local
 + wlan1 IPv4 _smb                               _tcp                 local
 + wlan1 IPv4 _workstation                       _tcp                 local

You should be easily figuring out how to modify the avahi-browse command to query specific local or remote (like provided on dns-sd.org) Zeroconf-enabled services.

GUI tools

Mac OS X: Bonjour Browser

For Mac, there is the no-cost GUI tool Bonjour Browser by Kevin Ballard available for download here:

It is rather old, but still works. At my current location, it displays this result in its very simple interface:

"Bonjour Browser" window displaying discovered services

Linux: avahi-discover

For Linux, there is the GUI app avahi-discover. It will display a similar simple interfaces as the above Bonjour Browser tool. Note, how clicking on a particular service instance will display all its TXT record contents in the lower window pane:

"avahi-discover" window displaying discovered services

Android, iOS

How Zeroconf Works

Zeroconf combines mainly two networking protocol ā€œstandardsā€ which have been layed down in a few IETF RFC documents:

  1. DNS-SD (DNS-based Service Discovery) as described in RFC6763 at http://www.ietf.org/rfc/rfc6763.txt
  2. mDNS (Multicast-based Domain Name Services) as described in RFC6762 at http://www.ietf.org/rfc/rfc6762.txt and RFC6761 at http://www.ietf.org/rfc/rfc6761.txt.

DNS Service Discovery works via multicast announcements and queries. The details about the exact protocol to be used (like using TCP/UDP port 5353, or addressing the reserved multicast IP address 224.0.0.251 and more) are defined as ā€œmDNSā€.

DNS-SD uses existing DNS record types to store, hold and cache specific information about services: SRV, TXT and PTR records. Thus, DNS-SD packets sent on the network are very similar to ā€œstandardā€ DNS packets. Therefor also, all standard DNS servers can be used to hold and deliver on request of clients all DNS-SD related information pieces.

Clients only have to be taught how to ask for specifics about a particular service type by knowing its name. More ā€œcomplicatedā€ services may use a number of (proprietary) TXT records which relate specific info to clients who know how to make use of them. Potential AirPrint clients for example are looking all IPP print services first, then for two specific TXT records to be present in their announcments: a pdl= field which contains the image/urf value, and the existence of an URF= field. If these two TXT records are present, an iPad will list this IPP printer as AirPrint capable. If further records like Duplex=T and Color=T are present, they will add duplex and color selection buttons to the print dialog user interface. The TXT record air=username,password tells the clients that they need username + password in order to use that AirPrint service.

Of course, Nextcloud developers need to come up with their own scheme of TXT records which they want to use for DNS-SD announcements via mDNS or standard wide area DNS, so clients are able to find and successfully connect to Nextcloud servers.

Developers who want to Zeroconf-enable their applications (or hardware devices) are recommended to, as a minimum, register a service type name directly through IANA. For ownCloud or Nextcloud these could be named as _owncloud and _nextcloud. You could even consider to register a preferred port number to be used. (Of course, you could even implement this functionality without registering a name, as long as Nextcloud servers and clients both know how to call each other, but this would be rather bad netizenshipā€¦)

Further Resources

Difficult to discover sub-pages of the dns-sd.org main website (Isnā€™t it ironic?) ā€“ URLs here:

Very detailed and useful info, but most users use Windows and need to be able to easily find their devices, so we would need instructions for the main user base.

Also, that didnā€™t work for me from another box, trying to get the IP of the zeroconf device:

# dig -p 5353 @224.0.0.251 owncloud.local

; <<>> DiG 9.10.4-P1 <<>> -p 5353 @224.0.0.251 owncloud.local
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

So thatā€™s not fool proof.

So thatā€™s not fool proof.

So hereā€™s more (hopefully) useful infoā€¦

Of course itā€™s not fool proof out of the box. However, it indeed becomes fool proof as soon asā€¦

  • ā€¦your owncloud.local. device uses mDNS to publish its host name. This should be the case automatically if it is a Linux box running the avahi-daemon service.

Is this, or is this not the case?

Also note, that all my example commands using a domain name should be using a final dot in all the domain names, including ā€œlocal.ā€ (I donā€™t know why I forgot it in some commands, because Iā€™m well aware that it could be very relevant; Iā€™ll correct it.) See this web site for an explanation: ā€œTrailing Dots in Domain Namesā€. Youā€™ll probably also notice, how all DNS responses include the trailing dots in the domain namesā€¦

However, in your particular case, if your owncloud-named device used DNS-SD/mDNS for announcing its hostname, the dig command should have been tolerant and forgiving enough to be able to resolve owncloud.local as well as owncloud.local.


Even my old Windows test box is able to ā€œresolveā€ the .local. TLD, as you can see from the following ping command:

 $ ping kp-w10-01.local.
  
  PING kp-w10-01.local. (192.168.177.21) 56(84) bytes of data.
  64 bytes from kp-w10-01.fritz.box (192.168.177.21): icmp_seq=1 ttl=128 time=108 ms
  64 bytes from kp-w10-01.fritz.box (192.168.177.21): icmp_seq=2 ttl=128 time=28.3 ms
  64 bytes from kp-w10-01.fritz.box (192.168.177.21): icmp_seq=3 ttl=128 time=50.7 ms
  ^C

The secret sauce behind that is that the box has iTunes installed. Which in turn includes Bonjour. Which in turn makes sure to announce iTuneā€™s presences (and its sharing of podcasts) via DNS-SD. Which, as a side effect, also reveals the hostname, and that it should really be addressed as kp-w10-01.fritz.box instead of kp-w10-01.local.ā€¦

Thatā€™s the problem, the Snap is using mDNS and if I run the command locally, then I see the hostname and IP being listed, but not from a remote box. I know it works for some people, but ideally, it should work for everybody.

But anyway, I think the client could use that if it helps make suggestions and if there arenā€™t any, then some documentation could be provided to the user to try alternative techniques. The problem comes from the server. NC is not shipped as a VM, so itā€™s up to the user to install mDNS and configure it. What would really help is a how-to so that users installing NC at home without using the Snap can make it easy for clients to discover the box, as youā€™ve described in your posts.

To be very honest with you, I have not the slightest clue what ā€œSnapā€ is. Iā€™m also not familiar with current ownCloud 7, 8 or 9 features, since playing with it myself was quite some years ago. Furthermore, Iā€™m not a developer/coder myself. So ā€“ Iā€™m sorry to have to talk to you from the perspective of a total ownCloud/Nextcloud noob.

My only guess is that whatever is using mDNS and DNS-SD here is not using it correctly or completely.

This should/could be a starting point how to debug this furtherā€¦

Yes. And Iā€™m pretty sure, by implementing Zeroconf functionality with the help of Avahi on Linux and with the help of the FOSS Bonjour SDK by Apple (for Windows clients), it will. The effort shouldnā€™t be all too greate, the code to be written should be minimal.

Hell, I could even register and announce a fake ownCloud server on my local network by running the following command an Mac OS X:

 $ dns-sd                                       \
     -R "Public ownCloud Demo (Dummy Only)"     \
     _http._tcp.,_owncloud                      \
     .                                          \
     443                                        \
     txtvers=1                                  \
     qtotal=1                                   \
     ty="@pdfkungfoo's Own Handmade Model"      \
     note="@pdfkungfoo's flat"                  \
     note2="(totally dummy and fake device)"    \
     air="username,password"                    \
     kind="documents,chat,movies,music,contacts,calendar" \
     adminurl="mailto:pdfkungfoo@gmail.com"     \
     TLS=1.2                                    \
     UUID=533f7ac6-1c37-11e6-ac21-ffa8e4bdcbf9  \
     DUUID=12345678-9ABC-DEF0-1234-56789ABCDEF0 \
     Chat=F                                     \
     Documents=T                                \
     Movies=F                                   \
     Music=T                                    \
     Contacts=T                                 \
     Calendar=T

ā€¦or with the analog avahi-publish command on Linux:

 $ avahi-publish                                \
    -s "Public Nextcloud Demo 2 (Dummy Only)" _nextcloud._tcp.  443  \
    -H kp-w10-01.local.                          \
    -d local.                                    \
      txtvers=1                                  \
      qtotal=1                                   \
      ty="@pdfkungfoo's Own Handmade Model"      \
      note="@pdfkungfoo's flat"                  \
      note2="(totally dummy and fake device)"    \
      air="username,password"                    \
      kind="documents,chat,movies,music,contacts,calendar" \
      adminurl="mailto:pdfkungfoo@gmail.com"     \
      TLS=1.2                                    \
      UUID=533f7ac6-1c37-11e6-ac21-ffa8e4bdcbf9  \
      DUUID=12345678-9ABC-DEF0-1234-56789ABCDEF0 \
      Chat=F                                     \
      Documents=T                                \
      Movies=F                                   \
      Music=T                                    \
      Contacts=T                                 \
      Calendar=T

ā€¦and both service instances are happily displayed by my Bonjour Browser or by avahi-discover:

Fake Nextcloud service announcement for my LAN

However, there is no client (yet) which could make use of my announcement, and could interpret my (completely made-up) TXT records spicing my DNS-SD announcements.

On the other hand, I also could proxy-announce (with the help of an Avahi command) in my local network a remote ownCloud server existing in real life, so my local nodes could more easily find it:

 $ avahi-publish      \
    -s "The Real ownCloud Demo Server" _http._tcp.  80 \
    -H demo.owncloud.org \
    -d local.               \
      path="apps/gallery"

(To keep this announcement valid and alive for a longer time, just run it in the background.)

If I enable Bonjour in Internet Explorer or in Safari, then the ownCloud demo website server appears in the list of published HTTP resources, with the local descriptive name Iā€™ve given to it in the announcement, and a single click connects the web client, directly going the path indicated by my path= TXT record:

Safari showing Avahi-published shortcut/bookmark pointing to ownCloud demo server

1 Like

What do you mean by this? Which exact URL is published, and in what way? Is it via mDNS as a DNS-SD announcement? Could you elaborate, please?

Not all browsers are DNS-SD or Bonjour enabled (Safari is; Windows IE is said to be, once Bonjour is installed on Windows) ā€“ so even if the URL announcement is 100% correct and perfect, it may not be used.

However, if you Zeroconf-enable Nextcloud clients, at least these should be able to auto-discover available Nextcloud servers/resourcesā€¦

I donā€™t blame you as itā€™s still a very young tech :slight_smile:
http://www.ubuntu.com/internet-of-things

Could be. Iā€™ll just post links to the set up if a dev wants to take a look at it

The command looks like this, but that probably wonā€™t tell you much since itā€™s using a custom made command.

# mdns-publisher owncloud

This results in the following entries

owncloud.local.         60      IN      A       1.2.3.4

And thatā€™s the biggest culprit and probably the reason it doesnā€™t work. Users of Chrome on Windows per example canā€™t reach owncloud.local

Yep, thatā€™s great for the clients, but for someone trying to set up their new NC box, it doesnā€™t work unless an app is shipped which finds all the boxes installed on the network. Thatā€™s what lots of networking and storage equipment vendors are providing.

Thanks for the info. I wasnā€™t aware of that so far.

Thanks. Iā€™ll have a look sometime in July and see if I can make ā€œheads and tailsā€ from itā€¦

Looks like a good A record to meā€¦ However: is the real host really using an IP address like this? Does the A record retrieved really match the deviceā€™s IP address?

I donā€™t have an ownCloud server here at the moment ā€“ but the Chrome browser on my Windows test box connects just fine to http://mycupsserver.local.:631/printers.

Internet Explorer connects to http://mycupsserver:631/printers after I added a ā€œlocal.ā€ entry to respective field for ā€œAppend these DNS suffixes (in order)ā€ on the DNS configuration tab:

How to make sure that Windows makes use of the  special domain.

The Nextcloud server itself should make sure that it its presence is announced (of course, this should be made easy to also switch off during the setup) via DNS-SD. Either via Bonjour or Avahi, or all by itself if it discovers no presence of a general Bonjour/Avahi service. (If it does it all by itself, it can limit its DNS-SD awareness to its own supported service types only.)

Yes, that was just an example and if I use the real IP as URL, I reach the box.

I suspect the problem is related to some firewall/router or network configuration issue, but this just highlights how different networks can be. I have no problem seeing the box in the network tab when enabling nmbd on it per example.

Let me get this rightā€¦ So do I understand it correctly:

A dig command like

 $ dig +nocmd -p 5353 @224.0.0.251 owncloud.local. +noall +answer

returns this result:

owncloud.local. 60 IN A x.x.x.x

But you cannot connect to https://owncloud.local. or https://owncloud.local or http://owncloud.local. or http://owncloud.local even though there is an ownCloud server at IP address x.x.x.x on port 80 and/or on port 443?

However, you can connect to https://x.x.x.x or to https://x.x.x.x ?

Can you successfully run

ping owncloud.local.

?

The dig command only returns that result when run locally, so the box seems configured properly, but the rest of the network does not know what .local is.

Interestingly, when run on the boxā€¦

# ping owncloud.local.
ping: unknown host owncloud.local.

Netstat lists mDNS

udp        0      0 *:mdns                  *:*
udp        0      0 *:mdns                  *:*
udp6       0      0 [::]:mdns               [::]:*
udp6       0      0 [::]:mdns               [::]:*

Iā€™m still confused. If you say ā€œwhen run locallyā€ I guess you mean when run on localhost? (Your ā€œlocallyā€ does not refer to other nodes on the LAN?)

If the other nodes on the LAN cannot successfully run ping owncloud.local., then they have probably no Avahi daeman running. If they have, it should work. If it doesnā€™t, Iā€™m at my witsā€™ end for nowā€¦ (On Windows it should work if Appleā€™s Bonjour is installed and the ā€œBonjour Serviceā€ is running, or a process with the name mDNSResponder is listed. On Macs Bonjour is running out of the box, in the shape of a process named mDNSResponder.)

Yes, that means that I log in via SSH and type the commands.

Iā€™ve checked and on Windows, I have 2 mDNSResponder services running :slight_smile:

Iā€™m going to check from a Linux box :slight_smile:

IMHO, this does not yet mean there is really an mDNS service there. It means something is using port 5353 (the ā€œwell knownā€ port used for mDNS).

Can you add -p -n for your (Linux) netstat command to see which process name binds to port 5353?

2 probably is 1 too many, if they are trying to wrestle both for listening access at port 5353. :slight_smile:

Itā€™s the correct app

udp        0      0 *:mdns                  *:*                                 10897/mdns-publishe
udp        0      0 *:mdns                  *:*                                 23100/mdns-publishe
udp6       0      0 [::]:mdns               [::]:*                              10897/mdns-publishe
udp6       0      0 [::]:mdns               [::]:*                              23100/mdns-publishe

Could be, but one of them is there to connect to a specific client.

I did a quick DLL search and quite a few apps are including the mdns dll, including browsers, so there shouldnā€™t be an issue.

I also tried from Ubuntu Xenial which is running avahi-daemon and dig couldnā€™t find owncloud.local.

Ok, Iā€™m at my witsā€™ end then while doing a dry-run debugging of this problem from a remote place.

Without access to the live thing itself, inside the respective environment, with my fingers on a network sniffer like Wireshark or tcpdump I have no real idea how to proceed further from here.

This debugging topic wasnā€™t the appropriate thing for this feature request thread anyway, and Iā€™m sorry to have made it happen here and today.

Hopefully it doesnā€™t deviate too much from what was intended. Can you turn this into a GitHub issue at some appropriate project location?

I completely agree, I just wanted to point out that it wasnā€™t that easy without some cooperation from the network and client env, but problems could stem from a misconfiguration on the box itself.

I encourage you to play with the Snap. Here are the instructions to install it. It works in a VM if you install the amd64 images. I even have i386 images for a slightly different version.

The wiki should have everything that you need, otherwise, just ask :slight_smile:

I wouldnā€™t worry about that.

This would be the projectā€™s issue tracker for now:

Try the snap if you can and if you find a problem, then youā€™re probably the best person to open an issue there. If not Iā€™ll just make a request to offer an alternative way to reach the box. In the end it may be that this can only be solved via some documentation.