/etc/resolv.conf 如何设置带端口的 nameserver?

2016-05-31 09:27:24 +08:00
 niuoh

google 了一圈没找到 求指点

12107 次点击
所在节点    DNS
10 条回复
leozhang
2016-05-31 09:34:20 +08:00
Dnsmasq 可以满足指定端口的需求
holyzhou
2016-05-31 09:37:11 +08:00
配置 dnsmasq 上游服务器,通过 dnsmasq 转
niuoh
2016-05-31 09:40:10 +08:00
就是说 不能通过 resolv.conf 配置了? 我用端口转发行不
firebroo
2016-05-31 10:35:25 +08:00
Dnsmasq
kfll
2016-05-31 10:56:16 +08:00
osx 的 resolver 兹磁:/t/135910

glibc 不支持
niuoh
2016-05-31 11:05:18 +08:00
@holyzhou 那 dnsmasq 配置 上游 dns 的格式是啥啊
Nin
2016-05-31 11:21:35 +08:00
@niuoh
dnsmasq 监听 53,
然后 /etc/resolv.conf nameserver 127.0.0.1
smileawei
2016-05-31 13:18:14 +08:00
dnsmasq 是正途。在 dnsmasq 定义 server=ip#port 然后在 /etc/resolv.conf 配置 nameserver 为 127.0.0.1
@niuoh
Lentin
2016-06-11 20:13:09 +08:00
伪造个不存在的假 IP 然后用 iptables 转发应该可行
iptables -t nat -A OUTPUT -p udp --dport 53 -d 255.255.233.233 -j DNAT --to-destination 208.67.222.222:5353
iptables -t nat -A OUTPUT -p tcp --dport 53 -d 255.255.233.233 -j DNAT --to-destination 208.67.222.222:5353
然后在 /etc/resolv.conf 写入
nameserver 255.255.233.233
yech1990
2017-08-07 13:01:24 +08:00
@smileawei
不应该是 listen-address=ip:port 么?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/282386

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX