查看Bind版本指令
named -V
BIND 9.8.4-P2 built with....後面省略
BIND設定檔案是在 /etc/namedb
#----------------------------------------
options {
// All file and path names are relative to the chroot directory,
// if any, and should be fully qualified.
directory "/etc/namedb/working";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
minimal-responses yes;
//回應查詢時,僅回應ANSWER部分
allow-query {any;};
//幫查詢不是自己的domainlisten-on { 112.105.100.41; };
//填入你主機的IP
// All file and path names are relative to the chroot directory,
// if any, and should be fully qualified.
directory "/etc/namedb/working";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
minimal-responses yes;
//回應查詢時,僅回應ANSWER部分
allow-query {any;};
//幫查詢不是自己的domainlisten-on { 112.105.100.41; };
//填入你主機的IP
forwarders {
8.8.8.8;
};
8.8.8.8;
};
zone "example.com" { type master; file "/etc/namedb/master/example.db"; };
//查詢example.com的正解時,會依據這邊的檔案回應
#---------------------------------------
#cd /etc/namedb/master
#vi example.db
#--------------------------------------
//查詢example.com的正解時,會依據這邊的檔案回應
#---------------------------------------
#cd /etc/namedb/master
#vi example.db
#--------------------------------------
$TTL 60
@ IN SOA example.com. root.example.com. (
2013112713 ; Serial
172800 ; Refresh
60 ; Retry
360 ; Expire
60 ) ; Minimum
IN NS example.com.
IN A 112.105.100.41
www IN A 173.194.72.94
www1 IN CNAME www.google.com.tw.
ftp IN CNAME www
mail IN A 123.44.55.227
mail IN MX 10 www.twbsd.org
IN MX 20 mail.def.net
=======================================2013112713 ; Serial
172800 ; Refresh
60 ; Retry
360 ; Expire
60 ) ; Minimum
IN NS example.com.
IN A 112.105.100.41
www IN A 173.194.72.94
www1 IN CNAME www.google.com.tw.
ftp IN CNAME www
mail IN A 123.44.55.227
mail IN MX 10 www.twbsd.org
IN MX 20 mail.def.net
BIND啟動方式
ee /etc/rc.conf
#-------------------------
named_enable="YES"
#-------------------------
/etc/rc.d/named start
/usr/sbin/named –c /etc/namedb/namedb.conf
就可以用了
沒有留言:
張貼留言