 
   def terminate(_, state) do
     Logger.busy 3, "Stopping captive portal GenServer."
+
+    Logger.busy 3, "Stopping mDNS."
+    Mdns.Server.stop()
 
     Logger.busy 3, "Stopping DHCP GenServer."
     GenServer.stop(state.dhcp_server, :normal)

    :error
  end

end


  @interface Application.get_env(:farmbot, :captive_portal_interface, "wlan0")
  @address Application.get_env(:farmbot, :captive_portal_address, "192.168.25.1")
  @mdns_domain "farmbot-setup.local"

  @dnsmasq_conf_file "dnsmasq.conf"
  @dnsmasq_pid_file "dnsmasq.pid"
