我已经完成了dnsmasq的默认安装.当我运行dig时,它似乎使用dnsmasq(127.0.0.1),但结果不包括/ etc / hosts中包含的主机名.
/ etc / hosts中:
192.168.1.13 sun
在终端:
$dig sun ; <<>> DiG 9.6-ESV-R4 <<>> sun ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY,status: NXDOMAIN,id: 32131 ;; flags: qr rd ra; QUERY: 1,ANSWER: 0,AUTHORITY: 1,ADDITIONAL: 0 ;; QUESTION SECTION: ;sun. IN A ;; AUTHORITY SECTION: . 9699 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2011041100 1800 900 604800 86400 ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Tue Apr 12 05:20:56 2011 ;; MSG SIZE rcvd: 96
在终端:
$dig @localhost sun ; <<>> DiG 9.6-ESV-R4 <<>> @localhost sun ; (2 servers found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY,id: 43763 ;; flags: qr rd ra; QUERY: 1,ADDITIONAL: 0 ;; QUESTION SECTION: ;sun. IN A ;; AUTHORITY SECTION: . 10800 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2011041800 1800 900 604800 86400 ;; Query time: 40 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Mon Apr 18 17:15:23 2011 ;; MSG SIZE rcvd: 96
我尝试过使用本地和扩展主机/域名,但似乎无法让其中任何一个工作.我的主要目标是能够使用一台计算机来托管局域网DNS,我不在乎这些名称是sun还是sun.domain,无论什么工作.
这是我的/etc/resolv.conf
nameserver 127.0.0.1 domain members.linode.com search members.linode.com nameserver 72.14.188.5 nameserver 72.14.179.5
和/etc/dnsmasq.conf
domain-needed bogus-priv
如果它有所作为,这一切都在ubuntu 10.04机器上.我一直在关注本指南:http://www.mythicalbeast.co.uk/linux/dnsmasq_howto.html(虽然不是逐字逐句,因为它也设置了DHCP)