通过AccessPoint通过主机名访问cURL

问题描述 投票:0回答:1

我正在尝试向“ dnsmasq网络”内的主机名发送cURL请求

RaspberryPi用作IoT设备的接入点。 Whem我连接到AP,我可以卷曲他们的主机名没问题。在Raspberry中,它不起作用。

curl --interface wlan0 "http://gaertank2/relay"

导致

curl: (6) Could not resolve host: gaertank2

使用本地ip可以正常工作

Raspberry无法解析主机名但我的手机在同一网络中可以解析主机名的原因是什么?我想尽可能避免使用IP地址

curl hostname dnsmasq
1个回答
0
投票

确定在域名服务器生效后强制/etc/resolf.conf,dhcpd会覆盖对127.0.0.1所做的所有配置

© www.soinside.com 2019 - 2024. All rights reserved.