configurationDNS服务器的域名不带前缀

试图build立一个本地的DNS服务器,以加快内部网的发展。

我使用bind9将一个名为mydomain.com的子域设置为/etc/bind/db.mydomain.com。

问题是,我可以正确parsing地址,如server.mydomain.com,但服务器无法parsingmydomain.com(没有前缀)。

有什么我错过了吗?

(我的configuration类似于这篇文章http://www.geoffke.be/nieuws/8/ )

通常子域是一个不同的,独立的正向查找区域。 如果要使整个域可search,则需要每个域(mydomain.com,db.mydomain.com等)的正向查找区域。

或者简单地为mydomain.com创build一个正向查找区域,并为db.mydomain.com添加Alogging。 如果您不仅仅需要A和CNAMElogging,则每个域都需要一个不同的正向查找区域。

看看你使用的教程,我看到以下内容:

; IP addresses of local hosts (replace the lines with your own hosts): router IN A 192.168.1.1 ns1 IN A 192.168.1.2 www IN A 192.168.1.3 mediacenter IN A 192.168.1.4 laptop1 IN A 192.168.1.5 workstation1 IN A 192.168.1.6 

您为一堆子域build立了Alogging,但是没有为您的顶级域名(TLD)创buildAlogging。 只需添加一个Alogging,而不需要像这样定义一个子域:

 ; IP addresses of local hosts (replace the lines with your own hosts): IN A 192.168.1.100 router IN A 192.168.1.1 ns1 IN A 192.168.1.2 www IN A 192.168.1.3 mediacenter IN A 192.168.1.4 laptop1 IN A 192.168.1.5 workstation1 IN A 192.168.1.6 

其中192.168.1.100是您要指向的IP,并且您已设置。

没有弄清楚如何在bind9下configuration。

但使用dnsmasq服务解决了这个问题。

所以,我删除了bind9和udhcpd服务,而不是使用dnsmasq作为dhcp和dns服务提供者。 在dnsmasq中,它会先search本地的/ etc / hosts文件,在那里我只需要input任何我想欺骗lan客户端的域名。