pkgtool にて BIND 9.2.3 を アンインストールし bind-9.3.2.tgz を インストール します
$ su - Password: # named -v BIND 9.2.3 # cd /var/data/mkpackage/bind-9-3-2/ bind-9.3.2.tgz
ユーザーと グループ の作成 もし 存在してたら 不用
# cat /etc/group | grep named # cat /etc/passwd | grep named # groupadd -g 200 named # cat /etc/group | grep named named:x:200: # useradd -g named -d /var/named -s /bin/false -u 200 named # cat /etc/passwd | grep named named:x:200:200::/var/named:/bin/false
# pkgtool bind 9.2.3 dell # cd /var/log/setup/tmp/ # mv PKGTOOL.REMOVED bind_del_20060302_PKGTOOL.REMOVED # mv bind_del_20060302_PKGTOOL.REMOVED /home/mm/0001_first-step/ # chown mm.users /home/mm/0001_first-step/*
# cd - # pkgtool bind -9.3.2 Install
# cd /etc/ # find / -name named* /usr/local/man/man5/named.conf.5 /usr/local/man/man8/named.8 /usr/local/man/man8/named-checkconf.8 /usr/local/man/man8/named-checkzone.8 /usr/local/sbin/named /usr/local/sbin/named-checkconf /usr/local/sbin/named-checkzone /usr/local/include/isccfg/namedconf.h /usr/share/man/ja_JP.eucJP/man5/named.conf.5.gz /usr/share/man/ja_JP.eucJP/man8/named-xfer.8.gz /usr/share/man/ja_JP.eucJP/man8/named-bootconf.8.gz /usr/share/man/ja_JP.eucJP/man8/named.8.gz # cd # ls /usr/local/sbin/ dnssec-keygen* grub-md5-crypt* named* rndc-confgen* dnssec-signzone* grub-set-default* named-checkconf* grub* grub-terminfo* named-checkzone* grub-install* lwresd* rndc*
# pwd /var/data # mkdir jail # cd jail/ # mkdir named/ # mkdir dev etc var # mkdir -p var/named # mkdir -p var/run/named # cd dev/ # pwd /var/data/jail/dev
# mknod null c 1 3 # mknod random c 1 8 # ls -l |sed -e 1d crw-r--r-- 1 root root 1, 3 Mar 2 18:26 null crw-r--r-- 1 root root 1, 8 Mar 2 18:26 random # chmod 666 {null,random} # ls -l |sed -e 1d crw-rw-rw- 1 root root 1, 3 Mar 2 18:26 null crw-rw-rw- 1 root root 1, 8 Mar 2 18:26 random
# cd ../etc/ # ls -l /etc/localtime -rw-r--r-- 1 root root 73 Mar 2 16:12 /etc/localtime # pwd /var/data/jail/etc # cp /etc/localtime .
# pwd /var/data/jail/var/named # cp /mnt/var/named/bcnet.hosts* . # cp /mnt/var/named/localhost.* . # cp /mnt/var/named/root.hints . # pwd /var/data/jail # mv var/ etc/ dev/ named # cd named/ # ls -l | sed -e 1d drwxr-xr-x 2 root root 4096 Mar 2 18:45 dev/ drwxr-xr-x 2 root root 4096 Mar 2 18:45 etc/ drwxr-xr-x 4 root root 4096 Mar 2 18:45 var/
# cd etc/ # pwd /var/data/jail/named/etc # /usr/local/sbin/rndc-confgen -a -b 512 wrote key file "/etc/rndc.key" # mv /etc/rndc.key .
$ scp 192.168.0.8:/home/mm/named.conf . Password: named.conf 100% 2199 2.2KB/s 00:00 # mv /home/mm/named.conf . # ls -l | sed -e 1d -rw-r--r-- 1 root root 73 Mar 2 18:29 localtime -rw-r--r-- 1 mm users 2199 Mar 2 18:57 named.conf -rw------- 1 root root 141 Mar 2 18:52 rndc.key
rc.inet2 の抜粋
if [ -f /usr/local/sbin/named ]; then echo -n " named ON /usr/local/sbin/named" /usr/local/sbin/named -u named -t /var/data/jail/named/ -c etc/named.conf fi
# cd ../ # pwd /var/data/jail/named # ls -R .: dev/ etc/ var/ ./dev: null random ./etc: localtime named.conf rndc.key ./var: named/ run/ ./var/named: bcnet.hosts bcnet.hosts.rev localhost.rev localhost.zone root.hints ./var/run: named/ ./var/run/named:
# cd jail/named/var/named/ # cp bcnet.hosts bcnet.hosts_05 # cp bcnet.hosts.rev bcnet.hosts.rev_05 # cp localhost.rev localhost.rev_05 # cp localhost.zone localhost.zone_05 # mkdir u_data # mv *05 u_data/ # ls -l | sed -e 1d -rw-r--r-- 1 named named 506 Mar 2 18:37 bcnet.hosts -rw-r--r-- 1 named named 466 Mar 2 18:37 bcnet.hosts.rev -rw-r--r-- 1 named named 347 Mar 2 18:37 localhost.rev -rw-r--r-- 1 named named 271 Mar 2 18:37 localhost.zone -rw-r--r-- 1 named named 2517 Mar 2 18:37 root.hints drwxr-xr-x 2 root root 4096 Mar 2 20:19 u_data/ # cd ../../etc/ # cp named.conf named.conf_08 # pwd /var/data # chown -R named.named jail/
# cd /etc/rc.d/ # cp rc.inet2 0001_rc.inet2_org # vi rc.inet2 # diff -s rc.inet2 0001_rc.inet2_org 21,24c21 < if [ -f /usr/local/sbin/named ]; then < echo -n " named ON /usr/local/sbin/named" < /usr/local/sbin/named -u named -t /var/data/jail/named/ -c etc/named.conf < fi
# cd /var/log # :>syslog # :>messages # shutdown -r now
$ su - Password: # pwd /var/log # cat messages | grep named Mar 2 20:38:41 lx named[1170]: starting BIND 9.3.2 -u named -t /var/data/jail/named/ -c etc/named.conf Mar 2 20:38:41 lx named[1170]: loading configuration from '/etc/named.conf' Mar 2 20:38:41 lx named[1170]: no IPv6 interfaces found Mar 2 20:38:41 lx named[1170]: listening on IPv4 interface lo, 127.0.0.1#53 Mar 2 20:38:41 lx named[1170]: listening on IPv4 interface eth0, 192.168.0.5#53 Mar 2 20:38:41 lx named[1170]: command channel listening on 127.0.0.1#953 Mar 2 20:38:41 lx named[1170]: zone 0.0.127.in-addr.arpa/IN: loaded serial 20030121 Mar 2 20:38:41 lx named[1170]: zone 0.168.192.in-addr.arpa/IN: loaded serial 20030121 Mar 2 20:38:41 lx named[1170]: zone bcnet.ne.jp/IN: loaded serial 20030121 Mar 2 20:38:41 lx named[1170]: zone localhost/IN: loaded serial 20030121 Mar 2 20:38:41 lx named[1170]: running # exit logout
# dig @192.168.0.5 cricrima-sa.no-ip.info ; <<>> DiG 9.3.2 <<>> @192.168.0.5 cricrima-sa.no-ip.info ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61168 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3 ;; QUESTION SECTION: ;cricrima-sa.no-ip.info. IN A ;; ANSWER SECTION: cricrima-sa.no-ip.info. 60 IN A 219.164.88.154 ;; AUTHORITY SECTION: no-ip.info. 26908 IN NS nf1.no-ip.com. no-ip.info. 26908 IN NS nf2.no-ip.com. no-ip.info. 26908 IN NS nf3.no-ip.com. ;; ADDITIONAL SECTION: nf1.no-ip.com. 113288 IN A 204.16.252.8 nf2.no-ip.com. 29734 IN A 216.66.37.12 nf3.no-ip.com. 29737 IN A 70.86.196.66 ;; Query time: 200 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Thu Mar 2 21:02:22 2006 ;; MSG SIZE rcvd: 167 # dig @192.168.0.5 nyanta.no-ip.info mx ; <<>> DiG 9.3.2 <<>> @192.168.0.5 nyanta.no-ip.info mx ; (1 server found) ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34261 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 4 ;; QUESTION SECTION: ;nyanta.no-ip.info. IN MX ;; ANSWER SECTION: nyanta.no-ip.info. 60 IN MX 5 nyanta.no-ip.info. ;; AUTHORITY SECTION: no-ip.info. 26625 IN NS nf1.no-ip.com. no-ip.info. 26625 IN NS nf2.no-ip.com. no-ip.info. 26625 IN NS nf3.no-ip.com. ;; ADDITIONAL SECTION: nyanta.no-ip.info. 60 IN A 218.221.22.21 nf1.no-ip.com. 113005 IN A 204.16.252.8 nf2.no-ip.com. 29451 IN A 216.66.37.12 nf3.no-ip.com. 29454 IN A 70.86.196.66 ;; Query time: 207 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Thu Mar 2 21:07:05 2006 ;; MSG SIZE rcvd: 178
may be good? muy bien!
install test only normaly use bind server 192.168.0.8 nyantarou!
# cat /etc/resolv.conf domain bcnet.ne.jp nameserver 192.168.0.8
にゃんたろう 拝!
2006年 3月16日 (木) 22:48:51 JST 作成