1999/10/04

ネットワーク (15)


Domain Name System の実例


設定ファイルの探し方

 津田塾大学のDNSサーバ (外向け, ns.tsuda.ac.jp)
gw:/home/usr1/nitta 1> ps auxww | grep named
nitta    27051  0.4  0.6  972  668 pts/0    S 14:11:10  0:00 grep named
root       158  0.1  8.01109210056 ?        S   Sep 13 55:11 /usr/local/sbin/namedgw:/home/usr1/nitta 3> strings /usr/local/sbin/named | grep named.conf
/usr/local/etc/named.conf
gw:/home/usr1/nitta 4> ls -l /usr/local/etc/named.conf
lrwxrwxrwx   1 root           21 Sep  3 13:22 /usr/local/etc/named.conf -> /var/named/named.conf
gw:/home/usr1/nitta 5> cd /var/named/
gw:/var/named 6> ls -l
total 19
-rw-r--r--   1 root          268 Sep  3 18:28 127.zone
-rw-r--r--   1 root         1958 Sep  8 14:10 133.99.zone
-rw-r--r--   1 root         1901 Sep  3 19:25 133.99.zone.bak
-rw-r--r--   1 root          493 Sep  3 18:29 named.boot
-rw-r--r--   1 root         1157 Sep  3 18:28 named.conf
-rw-r--r--   1 root         2769 Sep  3 18:28 root.cache
-rw-r--r--   1 root         3191 Sep  8 14:07 tsuda.zone
-rw-r--r--   1 root         3281 Sep  3 19:25 tsuda.zone.bak


Name server on ns.tsuda.ac.jp

named.boot (bindの設定ファイル)
;
;	$Header:$
;
;

directory	/var/named


; type		domain			source host/file	backup file

cache		.						root.cache

;domain          tsuda.ac.jp
primary		tsuda.ac.jp		tsuda.zone
primary		0.0.127.in-addr.arpa	127.zone
primary		99.133.in-addr.arpa	133.99.zone 

; Japan internet
; 133.4.11.2	endo.wide.ad.jp
; 192.41.197.3	relay.cc.u-tokyo.ac.jp
; 203.178.136.62 ns.fujisawa.wide.ad.jp
;secondary	jp			133.4.11.2 		 bak/jp.zone
secondary	jp			203.178.136.62 		 bak/jp.zone

xfrnets				133.99.0.0


named.conf (bind8用の設定ファイル)
// generated by named-bootconf.pl

options {
	directory "/var/named";
	allow-transfer {
		133.99.0.0/16;
		203.178.137.71/32;
		203.178.136.62/32;
	};
	/*
	 * If there is a firewall between you and nameservers you want
	 * to talk to, you might need to uncomment the query-source
	 * directive below.  Previous versions of BIND always asked
	 * questions using port 53, but BIND 8.1 uses an unprivileged
	 * port by default.
	 */
	// query-source address * port 53;
};

// 
// $Header:$
// 
// 
// type		domain			source host/file	backup file
zone "." {
	type hint;
	file "root.cache";
};

// domain          tsuda.ac.jp
zone "tsuda.ac.jp" {
	type master;
	file "tsuda.zone";
};

zone "0.0.127.in-addr.arpa" {
	type master;
	file "127.zone";
};

zone "99.133.in-addr.arpa" {
	type master;
	file "133.99.zone";
};

// Japan internet
// 133.4.11.2	endo.wide.ad.jp
// 192.41.197.3	relay.cc.u-tokyo.ac.jp
// 203.178.136.62 ns.fujisawa.wide.ad.jp
// 203.178.136.63 ns.wide.ad.jp
// secondary	jp			133.4.11.2 		 bak/jp.zone
// after this line, if you needn't back up, delete them 
zone "jp" {
	type slave;
	file "bak/jp.zone";
	masters {
		203.178.136.63;
	};
};



tsuda.zone (正引き用データベース)
@                       IN      SOA     ns.tsuda.ac.jp. widemgr.tsuda.ac.jp. (
                                1.0046  ; Serial
                                300    ; Refresh
                                100     ; Retry
                                3600000 ; Expire
                                3600    ; Minimum
                                )
                        IN      NS      ns.tsuda.ac.jp.
                        IN      A       133.99.162.2
@                       IN      MX 10   ns.tsuda.ac.jp.
*                       IN      MX 10   ns.tsuda.ac.jp.
tsuda.ac.jp.            IN      MX 50   ns.tsuda.ac.jp.
*.tsuda.ac.jp.          IN      MX 50   ns.tsuda.ac.jp.
localhost.              IN      A       127.0.0.1
localhost               IN      CNAME   localhost.
loghost                 IN      CNAME   localhost.
;
ns			IN	A	133.99.162.2
                        IN      MX 10   dnss161.tsuda.ac.jp.
;                       IN      MX 100  xxx.wide.ad.jp.
                        IN      HINFO   "UltraI/140" "Solaris2.5"
gw			IN	A	133.99.161.5
karel1                  IN      A       133.99.10.1
                        IN      MX 10   karel1.tsuda.ac.jp.
davinci			IN	A	133.99.10.2
...省略...


127.zone (ループバック用データファイル)
;
;	$Header:$
;
@			IN	SOA	ns.tsuda.ac.jp. widemgr.tsuda.ac.jp. (
				1.0001	; Serial
				3600	; Refresh
				300	; Retry
				3600000 ; Expire
				3600	; Minimum
				)

                        IN      NS      ns.tsuda.ac.jp.
0			IN	PTR	loop-back.
1			IN	PTR	localhost.


133.99.zone (逆引き用データベース)
;
;	$Header:$
;
@			IN	SOA	ns.tsuda.ac.jp. widemgr.tsuda.ac.jp. (
				1.0025	; Serial
				3600	; Refresh
				1000	; Retry
				3600000 ; Expire
				3600	; Minimum
				)
			IN	NS	ns.tsuda.ac.jp.

2.162			IN	PTR	ns.tsuda.ac.jp.
1.10			IN	PTR	karel1.tsuda.ac.jp.
2.10			IN	PTR	davinci.tsuda.ac.jp.
3.10			IN	PTR	vermeer.tsuda.ac.jp.
4.10			IN	PTR	vltava.tsuda.ac.jp.
...省略...

Name server on dnss161.tsuda.ac.jp

ns.tsuda.ac.jpの設定と異なる点