mDNS responder

Browse source code on GitHub

Overview

This application will wait mDNS queries for a pre-defined hostname and respond to them. The default hostname is zephyr and it is set in the prj.conf file.

Requirements

Building and Running

Build and run the mdns-responder sample application like this:

west build -b <board to use> samples/net/mdns_responder -- -DCONF_FILE=<config file to use>

After the mdns-responder sample application is started, it will await queries from the network.

Open a terminal window in your host and type:

$ avahi-resolve -4 -n zephyr.local

If the query is successful, then following information is printed:

zephyr.local        192.0.2.1

For a IPv6 query, type this:

$ avahi-resolve -6 -n zephyr.local

If the query is successful, then following information is printed:

zephyr.local        2001:db8::1

Lastly, resolve services using DNS Service Discovery:

$ avahi-browse -t -r _zephyr._tcp

If the query is successful, then the following information is printed:

+   zeth IPv6 zephyr                                        _zephyr._tcp         local
=   zeth IPv6 zephyr                                        _zephyr._tcp         local
   hostname = [zephyr.local]
   address = [192.0.2.1]
   port = [4242]
   txt = []

Wi-Fi

The IPv4 Wi-Fi support can be enabled in the sample with Wi-Fi snippet.

See also

Network Core Library
DNS Service Discovery
BSD Sockets compatible API