我有一个应用程序,其中有一个在 ESP32 设备上运行的 mDNS 服务器。它的主机名是esp32-mdns.local
。我可以从 Windows ping 此主机名。但是,在我的 Ubuntu 22.04 系统上无法做到这一点。
我已重新安装了 avahi 守护程序和实用程序。当我这样做时avahi-browse --all
:
avahi-browse -all
+ wlp0s20f3 IPv6 192-168-178-1 Microsoft Windows Network local
+ wlp0s20f3 IPv6 fritz-box Microsoft Windows Network local
+ wlp0s20f3 IPv4 192-168-178-1 Microsoft Windows Network local
+ wlp0s20f3 IPv4 fritz-box Microsoft Windows Network local
+ wlp0s20f3 IPv6 ESP32-WebServer1 Web Site local
+ wlp0s20f3 IPv6 ESP32-WebServer Web Site local
+ wlp0s20f3 IPv4 ESP32-WebServer1 Web Site local
+ wlp0s20f3 IPv4 ESP32-WebServer Web Site local
然后avahi-resolve --name esp32-mdns.local
:
avahi-resolve --name esp32-mdns.local
esp32-mdns.local 192.168.178.71
因此,名称已得到解析,但是当我 ping 它时:
ping esp32-mdns.local
ping: esp32-mdns.local: Name or service not known
我可以直接 ping IP 地址,但不能 ping 主机名。
这是我的/etc/avahi/avahi-daemon.conf
文件。我遗漏了什么吗?或者可能是什么问题?谢谢。
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
# See avahi-daemon.conf(5) for more information on this configuration
# file!
[server]
#host-name=foo
#domain-name=local
#browse-domains=0pointer.de, zeroconf.org
use-ipv4=yes
use-ipv6=yes
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
#disallow-other-stacks=no
#allow-point-to-point=no
#cache-entries-max=4096
#clients-max=4096
#objects-per-client-max=1024
#entries-per-entry-group-max=32
ratelimit-interval-usec=1000000
ratelimit-burst=1000
[wide-area]
enable-wide-area=yes
[publish]
#disable-publishing=no
#disable-user-service-publishing=no