A seguir está minha configuração bind9
o domínio que eu quero configurar é home.lan é a rede doméstica
/etc/bind/named.conf.local está seguindo
zone "home.lan" IN {
type master;
file "/etc/bind/zones/home.lan.db";
};
zone "1.168.192.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";
};
/etc/bind/named.conf.options está seguindo
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
como é uma rede pessoal, não preciso de nenhuma seção de encaminhadores, por isso não a configurei.
/etc/bind/zones/home.lan.db
; Use semicolons to add comments.
; Host-to-IP Address DNS Pointers for home.lan
; Note: The extra “.” at the end of the domain names are important.
; The following parameters set when DNS records will expire, etc.
; Importantly, the serial number must always be iterated upward to prevent
; undesirable consequences. A good format to use is YYYYMMDDII where
; the II index is in case you make more that one change in the same day.
$ORIGIN .
$TTL 86400 ; 1 day
home.lan. IN SOA ubuntu.home.lan. hostmaster.home.lan. kalu.home.lan. (
2008080901 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
; NS indicates that ubuntu is the name server on home.lan
; MX indicates that ubuntu is (also) the mail server on home.lan
home.lan. IN NS kalu.home.lan.
home.lan. IN MX 10 ubuntu.home.lan.
$ORIGIN home.lan.
; Set the address for localhost.home.lan
localhost IN A 127.0.0.1
; Set the hostnames in alphabetical order
home IN A 192.168.1.7
ntinstall IN A 192.168.1.7
kalu IN A 192.168.1.7
router IN A 192.168.1.1
server IN A 192.168.1.5
e /etc/bind/zones/rev.1.168.192.in-addr.arpa
; IP Address-to-Host DNS Pointers for the 192.168.1 subnet
@ IN SOA ubuntu.home.lan. hostmaster.home.lan. (
2008080901 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ; minimum
)
; define the authoritative name server
IN NS ubuntu.home.lan.
; our hosts, in numeric order
1 IN PTR router.home.lan.
2 IN PTR ubuntu.home.lan.
3 IN PTR ntinstall.home.lan.
4 IN PTR kalu.home.lan.
e / etc / hostnames
kalu
e /etc/resolv.conf no servidor bind9 é
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search home.lan
at the client machine
/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
nameserver 192.168.1.7
search home.lan
e da máquina cliente quando tento pingar
Eu recebo
$ ping kalu.home.lan
ping: unknown host kalu.home.lan
não há arquivo como /var/log/bind.log
então não tenho certeza onde procurar
aqui está cavar a saída no servidor
cavar kalu.home.lan
; <<>> DiG 9.8.1-P1 <<>> kalu.home.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 36937
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kalu.home.lan. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 11 23:59:03 2013
;; MSG SIZE rcvd: 31
e na máquina cliente, o dig kalu.home.lan dá o seguinte
dig kalu.home.lan
; <<>> DiG 9.8.1-P1 <<>> kalu.home.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25537
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;kalu.home.lan. IN A
;; AUTHORITY SECTION:
. 7388 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2013101101 1800 900 604800 86400
;; Query time: 43 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 11 23:59:34 2013
;; MSG SIZE rcvd: 106
qual é o erro na configuração acima dns?
kalu é o nome do host da máquina na qual estou configurando tudo isso.
Para ativar o loggin na ligação 9 rndc querylog
mostra
Oct 12 01:42:16 ubuntu named[11408]: dns_rdata_fromtext: /etc/bind/zones/home.lan.db:11: near 'kalu.home.lan.': not a valid number
Oct 12 01:42:16 ubuntu named[11408]: zone home.lan/IN: loading from master file /etc/bind/zones/home.lan.db failed: not a valid number
Oct 12 01:42:16 ubuntu named[11408]: zone home.lan/IN: not loaded due to errors.
Oct 12 01:42:16 ubuntu named[11408]: zone localhost/IN: loaded serial 2
Oct 12 01:42:16 ubuntu named[11408]: managed-keys-zone ./IN: loaded serial 5
e vejo
sudo named-checkzone home.lan home.lan.db
[sudo] password for hp:
zone home.lan/IN: loading from master file home.lan.db failed: file not found
zone home.lan/IN: not loaded due to errors.