Bind9 设置了转发但似乎没用


手上有一个需求,架一个ns,在解析请求为 a.xxx.com的时候返回指定IP,其他*.xxx.com解析请求的时候到公司ns上去查找对应IP。


 $TTL    86400
    @    IN      SOA     ns admin (
            2015060211
            28800
            3600
            604800
            38400
    )
               IN   NS      ns.xxx.com. 
    ns        IN   A           x.x.x.x                    //本机内网IP
   a       IN      A      y.y.y.y //目标

在测试机上配好resolv.conf后,发现nslookup a.xxx.com是OK的,但是nslookup其他地址如b.xxx.com则返回NXDOMAIN (b.xxx.com在公司ns上可以解析)
named.conf里已经设置options为:


 options {
    forwarders {x.x.x.x; y.y.y.y};    //x.x.x.x与y.y.y.y均为公司ns地址
};

named.conf里只有这一个options因此应该不存在被覆盖的问题

求问为何没法转发?

bind9

比那萌居觉子 10 years, 7 months ago

PS: 因为需求特殊
- 只能用bind9
- 不能改hosts

爱潜水的河马 answered 10 years, 7 months ago

规模不大的话,用 dnsmasq;
因为很简单,可以直接读取hosts来实现,不用定义bind9的那么多规则。

http://www.thekelleys.org.uk/dnsmasq/doc.html

YYlong answered 10 years, 7 months ago

Your Answer