问题标签 [dnsmasq]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2492 浏览

linux - dnsmasq 与 iPhone 失败

我正在尝试在 Linux 上使用 dnsmasq 作为 wifi 接入点。Windows 7 和 Android 智能手机可以很好地连接到 Linux 系统,但我的 iPhone 不能。Windows 和 iPhone 都可以使用 wpa_supplicant 进行身份验证,但问题是 iPhone 永远不会获得 IP 地址。

我的 dnsmasq.conf 配置文件非常简单:

dnsmasq 调试日志为 Windows 显示了这一点,您可以看到它是成功的:

但是,它为 iPhone 显示了这一点:

它就坐在那里!

有什么建议或帮助吗?谢谢!

0 投票
1 回答
29066 浏览

apache - ** server can't find hostname.com nxdomain

I am trying to set up an apache web server on my vm and im running into some issues. When I do an 'nslookup' on the hostname of the machine this is what I get:

I'm sure this is a common problem but I'm not sure how to fix it. It seems that dnsmasq can't resolve the hostname. Adding the hostname to /etc/hosts doesn't fix it. Running on an RHEL6.4 machine. Thanks in advance.

0 投票
1 回答
2463 浏览

macos - dnsmasq & multiple addresses

I'm using dnsmasq for my local development environment but I want to use multiple TLDs, currently my dnsmasq.conf file looks like this

& apache http-vhosts.conf looks like this

and this configuration works, just create a new folder called 'client' for example then you can access it from client.dev.

Now I want to add another TLD let's say .test how can this be done? I guess in Apache it's the same but replacing dev with test, what about dnsmasq?

0 投票
0 回答
1411 浏览

linux - 连接到 Linux 网桥的接口上的 dnsmasq 不工作

我有几个 Ubuntu 虚拟机。一个带有 DHCP 服务器,其余的是客户端。

在 DHCP 服务器上,

  • 我创建了一个 Linux 网桥 (br-1)
  • 将静态 IP 分配给 eth1。
  • 将接口 eth1 连接到桥接 br-1。
  • 在 eth1 上运行 dnsmasq。

然后我从一个客户端运行'dhclient -v eth1',希望获得一个IP。但它不起作用。但是,如果我只是将 eth1 移出网桥并从我的一个客户端 VM 尝试 dhclient,则客户端会获得正确分配的 IP。我不确定为什么。谁能指出我在这里缺少什么?

我还尝试了以下 -

  • 为网桥 (br-1) 分配子网范围内的静态 IP 作为 eth1。
  • 为网桥 IP 添加默认网关。
  • 为 eth1 IP 添加默认网关。
  • 完全禁用 IP 表。

以上都没有帮助。我必须使用 Linux 网桥,因为它是更大需求的一部分。

任何指针都会有很大帮助。

谢谢 !

0 投票
1 回答
1306 浏览

dhcp - dnsmasq 和 dhcp-helper 并存问题

我们在具有多个网桥的设备中同时运行 dhcp-helper 和 dnsmasq。(例如,br0 从 DNSMASQ 获取 ip 地址,br1 通过 dhcp 中继从另一个 dhcp 服务器获取 ip。)

以下是我操作的步骤:

  1. br0 上的活动 dnsmasq

  2. 用于备用端口 1067/1068 的 br1 上带有 -p 选项的活动 dhcp-helper

  3. 添加 iptables 规则以从 br1 重定向 dhcp 请求: iptables -I PREROUTING -t nat -i br1 -p udp --src 0.0.0.0 --dport 67 -j DNAT --to 0.0.0.0:1067

之后,似乎dhcp请求成功重定向到端口1067上的中继服务器(我可以捕获iptables INPUT链中的请求),但我无法使用wireshark捕获来自中继服务器的dhcp请求。

我还可以做些什么?如何让 dhcp-helper 和 dnsmasq 在我的设备中共存?

0 投票
0 回答
1390 浏览

android - dnsmasq,Android 没有收到地址

我在 Android 手机上从 dnsmasq 获取地址时遇到问题。

我在树莓派上运行 dnsmasq 和 hostapd。Hostapd 连接和握手工作正常。使用调试开关运行 dnsmasq 会返回:

运行命令:

配置文件:

Android想要我错过了什么?另外,服务的第一个地址是 204?这似乎有点奇怪。(我检查过没有其他 dhcp 服务器正在运行)

0 投票
1 回答
3332 浏览

dns - 如何限制 dnsmasq 仅回复特定的客户端 DNS 请求?

我正在考虑使用 dnsmasq 服务器轻松提供一些本地临时主机名,并为本地客户端提供递归 DNS。

但是,一旦将 dnsmasq 服务配置为递归 DNS 服务器,它似乎总是允许任何客户端查找 DNS 条目。

有没有办法限制 dnsmasq 服务只允许来自本地客户端的请求,比如 192.168.0.0/16 和 127.0.0.0/8 甚至可能是一些选择的公共 IP?

我可以用 iptables 做到这一点,但如果我可以将与 DNS 相关的配置保留在 dnsmasq 本地会更好。

0 投票
4 回答
2746 浏览

raspberry-pi - 在 RaspberryPi 上使用 arch linux 解析主机名

我有一个在 Arch linux 上运行 hostapd 和 dhcpd 的 Pi,以创建它自己的土地,Pi 的(路由器)IP 为10.0.0.1. 这使用 wlan0 接口,它仅用作运行 Web 服务器的独立路由器。

连接到 Pi 后,我会使用它10.0.0.1来显示网页,但我想使用主机名,例如firepi. 我曾尝试使用 dnsmasq,但没有成功。任何帮助将不胜感激,特别是如果你能给我一些详细的例子,因为我是一个新手。

这个系统的目的是我创建了一个网络应用程序,您可以使用它在安全距离上通过 WiFi 点燃烟花。我只想使用主机名而不是 IP 地址来方便。

我必须补充一点,如果这会影响任何事情,我很可能会使用 iPhone 连接到服务器。

0 投票
1 回答
291 浏览

c# - 在 C# 中以编程方式更改 DNS 服务器

我在两个位置 location1 和 location2 有一个 Web 服务,现在我的应用程序应该从 location1 访问该服务,如果它在 location1 不可用,那么只有它必须转到 location2 我可以根据我的要求使用 C# 务实地配置 dns

0 投票
1 回答
559 浏览

dns - dnsmasq 配置被绕过

我真的在为 dnsmasq 设置而苦苦挣扎。

我的 dnsmasq 配置包含(除其他外),以​​下

我的网络管理器 conf 和 resolve conf 肯定包括 127.0.0.1 作为第一个名称服务器。

如果我跑

我明白了

(是的,mysite.local 是一个监听 80 端口的 apache 虚拟主机)。

但是,如果我浏览或 wget 到 mysite.local,我会得到:

运行 Ubuntu 12.04。使用 dnsmasq 调试跟踪 syslog 的输出表明 wget 或浏览器都不会查询 dnsmasq 的 .local 域,但在 .local 域上运行 dig 工作正常。

任何想法都非常感谢。