0

我正在尝试测试 dnsmasq 和未绑定的服务器。当我从机器“Y”执行 getaddrinfo() 请求时,我从 dnsmasq 服务器机器“X”得到 dns 查询响应。但是,当我通过关闭 dnsmasq 并在机器“X”上启动未绑定服务器从“Y”从未绑定客户端的 API发送 dns 查询时,我看不到任何 dns 响应/解析。

我已经从源代码安装了未绑定的服务器,并在“X”上解决了它对 RHEL5 的依赖关系。

我在机器“X”上启动未绑定服务器:

unbound -c /usr/local/etc/unbound/unbound.conf

它正常启动,没有任何错误。

unbound.conf 的配置是:

server:
        verbosity: 1
## Specify the interface address to listen on:
        interface: xxx.xxx.xxx.xxx
## To listen on all interfaces use:
#       interface: 0.0.0.0
        do-ip4: yes
        do-ip6: yes
        do-udp: yes
        do-tcp: yes
        do-daemonize: yes
        access-control: 0.0.0.0/0 allow
## Other access control examples
#access-control: 192.168.1.0/24 action
## 'action' should be replaced by any one of:
#deny (drop message)
#refuse (sends  a  DNS  rcode REFUSED error message back)
#allow (recursive ok)
#allow_snoop (recursive and nonrecursive ok).
## Minimum lifetime of cache entries in seconds.  Default is 0.
#cache-min-ttl: 60
## Maximum lifetime of cached entries. Default is 86400 seconds (1  day).
#cache-max-ttl: 172800
## enable to not answer id.server and hostname.bind queries.
        hide-identity: yes
## enable to not answer version.server and version.bind queries.
        hide-version: yes
## default is to use syslog, which will log to /var/log/messages.
use-syslog: yes
## to log elsewhere, set 'use-syslog' to 'no' and set the log file location below:
#logfile: /var/log/unbound
python:
remote-control:
        control-enable: no
## Stub zones are like forward zones (see below) but must only contain authority server (no recursive servers)
#stub-zone:
#        name: "my.test.com"
## Note for forward zones, the destination servers must be able to handle recursion to other DNS server
## Forward all *.example.com queries to the server at 192.168.1.1
#forward-zone:
#        name: "example.com"
#        forward-addr: 192.168.1.1
## Forward all other queries to the Verizon DNS servers
forward-zone:
        name: "."
## Level3 Verizon
        forward-addr: 4.2.2.1
        forward-addr: 4.2.2.4

请告诉我我是否在哪里出错了,还想知道 dnsmasq 服务器是否实现线程/fork 子进程来处理查询,我们可以在 /etc/dnsmasq.conf 中设置相同的吗?

4

2 回答 2

3

必须在unbound.conf中添加配置:

access-control: <IP of client machine>/8 allow_snoop
于 2014-07-17T07:21:49.657 回答
1

Unbound 有一个 IP 白名单。您必须将您的 IP 添加到该列表中。

访问控制:/8 allow_snoop

Dnsmasq 实现了一个进程模型。因此,他将为每个新请求派生一个新进程,但 Unbound 对处理所有即将到来的请求时产生的进程数进行静态计数,并且您也可以在未绑定的情况下使用线程。

于 2014-07-19T06:42:32.963 回答