- 论坛徽章:
- 0
|
- $TTL 86400
- $ORIGIN localhost.
- @ 1D IN SOA @ root (
- 42 ; serial (d. adams)
- 3H ; refresh
- 15M ; retry
- 1W ; expiry
- 1D ) ; minimum
- 1D IN NS @
- 1D IN A 127.0.0.1
复制代码
- $TTL 86400
- @ IN SOA localhost. root.localhost. (
- 1997022700 ; Serial
- 28800 ; Refresh
- 14400 ; Retry
- 3600000 ; Expire
- 86400 ) ; Minimum
- IN NS localhost.
- 1 IN PTR localhost.
复制代码
- options {
- directory "/etc/namedb/";
- pid-file "/var/run/named/pid";
- allow-query { any; };
- # statistics-file "/var/log/stats.log";
- version "Windows 2003 Dns Server v6.0";
- # listen-on port 53 { 192.168.23.133; };
- recursion yes;
- datasize 50M;
- rrset-order { order random; };
- };
- logging {
- channel warning {
- file "/var/log/dns_warnings.log" versions 5 size 1024K;
- severity warning;
- print-category yes;
- print-severity yes;
- print-time yes;
- };
- channel security_log {
- file "/var/log/dns_security.log" versions 5 size 1024K;
- severity info;
- print-category yes;
- print-severity yes;
- print-time yes;
- };
- channel query_log {
- file "/var/log/dns_query.log" versions 10 size 1024K;
- severity info;
- print-category yes;
- print-severity yes;
- print-time yes;
- };
- category default { warning; };
- category security { security_log; };
- category queries { query_log; };
- };
- zone "." IN {
- type hint;
- file "named.root";
- };
- zone "localhost" IN {
- type master;
- file "localhost.zone";
- allow-update { none; };
- };
- zone "0.0.127.in-addr.arpa" IN {
- type master;
- file "named.local";
- allow-update { none; };
- };
- include "custom_dm.conf"; #包含域名定义文件
复制代码mkdir master
vi master/thismail.org.zone $ORIGIN thismail.org.
$TTL 300
@ IN SOA ns1.thismail.org. webmaster.thismail.org. (
2008041001 ; serial number YYMMDDNN
28800 ; Refresh
7200 ; Retry
864000 ; Expire
300 ; Min TTL
)
thismail.org. IN NS ns1.thismail.org.
thismail.org. IN NS ns2.thismail.org.
ns1 IN A 192.168.23.133
thismail.org. IN MX 10 mail.thismail.org.
thismail.org. IN A 192.168.0.9
www IN A 192.168.0.9
mail IN A 192.168.0.25
pop IN CNAME mail.thismail.org.
smtp IN CNAME mail.thismail.org.
thismail.org. IN TXT "v=spf1 ip4:192.168.0.25 ~all"
;邮件SPF设置
- zone "thismail.org" {
- type master;
- file "master/thismail.org.zone";
- };
复制代码
touch /var/log/dns_warnings.log
touch /var/log/dns_security.log
touch /var/log/dns_query.log
chown bind /var/log/dns_warnings.log
chown bind /var/log/dns_security.log
chown bind /var/log/dns_query.log
Xshell:\> nslookup
> server 192.168.23.133
Default Server: [192.168.23.133]
Address: 192.168.23.133
> www.qq.com
Non-authoritative answer:
Server: [192.168.23.133]
Address: 192.168.23.133
Name: www-cdn.qq.com
Address: 60.28.232.119
Aliases: www.qq.com
> www.freebsdchina.org
Non-authoritative answer:
Server: [192.168.23.133]
Address: 192.168.23.133
Name: www.freebsdchina.org
Address: 61.129.66.78
测试thismail.org
> www.thismail.org
Server: [192.168.23.133]
Address: 192.168.23.133
Name: www.thismail.org
Address: 192.168.0.9
> set type=mx
> thismail.org
Server: [192.168.23.133]
Address: 192.168.23.133
thismail.org MX preference = 10, mail exchanger = mail.thismail.org
thismail.org nameserver = ns1.thismail.org
thismail.org nameserver = ns2.thismail.org
mail.thismail.org internet address = 192.168.0.25
ns1.thismail.org internet address = 192.168.23.133
> set type=txt
> thismail.org
Server: [192.168.23.133]
Address: 192.168.23.133
thismail.org text =
"v=spf1 ip4:192.168.0.25 ~all"
thismail.org nameserver = ns2.thismail.org
thismail.org nameserver = ns1.thismail.org
ns1.thismail.org internet address = 192.168.23.133 |
|