設定して行こう (取り敢えず ファイルは コピーしてきてあるので 此処では 記載しないが まとめて 後で 示す予定である)、そこで コピーしたもののシリアル番号だけは変更して、設定にかかろう
# pwd
/etc
# /usr/local/sbin/rndc-confgen -a -b 512
wrote key file "/etc/rndc.key"
# mkdir /var/run/named
# touch /var/run/named/named.pid
# named-checkconf
# named-checkzone bcnet.hosts /var/named/bcnet.hosts
zone bcnet.hosts/IN: loaded serial 2005071422
OK
# named-checkzone bcnet.hosts.rev /var/named/bcnet.hosts.rev
zone bcnet.hosts.rev/IN: loaded serial 2005071422
OK
# named-checkzone localhost.zone /var/named/localhost.zone
zone localhost.zone/IN: loaded serial 2005071422
OK
# named-checkzone localhost.rev /var/named/localhost.rev
zone localhost.rev/IN: loaded serial 2005071422
OK
# /usr/local/sbin/named -u named
Jul 14 11:41:38 nl named[415]: couldn't open pid file '/var/run/named/named.pid'
: File exists
お怒りになってるようだ
# pwd
/var
# chown -R named named
# chgrp named -R named
# pwd
/var/run
# chown -R named named/
# chgrp -R named named/
# /usr/local/sbin/named -u named
お怒りは収まったようです 検査 続行しましょう
# /usr/local/bin/dig @127.0.0.1 bcnet.ne.jp soa
; <<>> DiG 9.3.1 <<>> @127.0.0.1 bcnet.ne.jp soa
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32184
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;bcnet.ne.jp. IN SOA
;; ANSWER SECTION:
bcnet.ne.jp. 86400 IN SOA nl.bcnet.ne.jp. root.nl.bcnet.ne
.jp. 2005071422 3600 900 604800 86400
;; AUTHORITY SECTION:
bcnet.ne.jp. 86400 IN NS nl.bcnet.ne.jp.
;; ADDITIONAL SECTION:
nl.bcnet.ne.jp. 86400 IN A 192.168.0.8
;; Query time: 23 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jul 14 21:47:06 2005
;; MSG SIZE rcvd: 103
次は
# /usr/local/bin/dig @127.0.0.1 bcnet.ne.jp ns
; <<>> DiG 9.3.1 <<>> @127.0.0.1 bcnet.ne.jp ns
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13114
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;bcnet.ne.jp. IN NS
;; ANSWER SECTION:
bcnet.ne.jp. 86400 IN NS nl.bcnet.ne.jp.
;; ADDITIONAL SECTION:
nl.bcnet.ne.jp. 86400 IN A 192.168.0.8
;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jul 14 21:56:37 2005
;; MSG SIZE rcvd: 62
へてから
# /usr/local/bin/dig @127.0.0.1 nl.bcnet.ne.jp a
; <<>> DiG 9.3.1 <<>> @127.0.0.1 nl.bcnet.ne.jp a
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35190
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;nl.bcnet.ne.jp. IN A
;; ANSWER SECTION:
nl.bcnet.ne.jp. 86400 IN A 192.168.0.8
;; AUTHORITY SECTION:
bcnet.ne.jp. 86400 IN NS nl.bcnet.ne.jp.
;; Query time: 26 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jul 14 21:59:36 2005
;; MSG SIZE rcvd: 62
# pwd
/etc/rc.d
# cp rc.inet2 004_rc.inet2_org
# vi rc.inet2
# diff -s 004_rc.inet2_org rc.inet2
54,57c54,64
< # if [ -f ${NET}/named ]; then
< # echo -n " named"
< # ${NET}/named
< # fi
---
> if [ -f /usr/local/sbin/named ]; then
> echo -n " named start by named"
> /usr/local/sbin/named -u named
> fi
>
> # # Thu Jul 14 22:10:22 JST 2005 add below
> # # Start the NAMED/BIND name server.
> if [ -f ${NET}/named ]; then
> echo -n " named"
> ${NET}/named
> fi
# shutdown -r now
# ps ax | grep named
123 ? S 0:00 /usr/local/sbin/named -u named
# cat messages | grep named
Jul 14 22:18:21 nl named[123]: starting BIND 9.3.1 -u named
Jul 14 22:18:21 nl named[123]: loading configuration from '/etc/named.conf'
Jul 14 22:18:21 nl named[123]: no IPv6 interfaces found
Jul 14 22:18:22 nl named[123]: listening on IPv4 interface lo, 127.0.0.1#53
Jul 14 22:18:22 nl named[123]: listening on IPv4 interface eth0, 192.168.0.8#53
Jul 14 22:18:22 nl named[123]: command channel listening on 127.0.0.1#953
Jul 14 22:18:22 nl named[123]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2005071422
Jul 14 22:18:22 nl named[123]: zone 0.168.192.in-addr.arpa/IN: loaded serial 2005071422
Jul 14 22:18:22 nl named[123]: zone bcnet.ne.jp/IN: loaded serial 2005071422
Jul 14 22:18:22 nl named[123]: zone localh
bind の ファイル 暫定版は ここに あります。実際の運用してるものとは、色々変更して変わってま すが 参考までに、基本的に 外部との やり取りは 行っていないので 未検証 の ものです。というより インターネットの仲間には入れません
にゃんたろう 拝!
2005年 7月19日 (火) 21:13:23 JST 作成