站長部落格 - lutuni 的日誌 |
![]() ![]() |
2014/10/17
Configure DNS server which resolves domain name or IP address.
作者: lutuni (2:46 pm)
|
[1] Install BIND root@dlp:~# aptitude -y install bind9 bind9utils [2] Configure BIND This example is done with grobal IP address [ 59.125.159.70/29 ], Private IP address [ 192.168.1.0/24 ], Domain name [ dadiling.com ]. However, Please use your own IPs and domain name when you set config on your server. ( Actually, [59.125.159.70/29] is for private IP address, though. ) root@dlp:~# vim /etc/bind/named.conf include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; # make it comment # include "/etc/bind/named.conf.default-zones"; # add include "/etc/bind/named.conf.internal-zones"; include "/etc/bind/named.conf.external-zones"; root@dlp:~# vim /etc/bind/named.conf.internal-zones # create new # define for internal section view "internal" { match-clients { localhost; 192.168.1.0/24; }; zone "." { type hint; file "db.root"; }; # set zone for internal zone "dadiling.com" { type master; file "dadiling.com.lan"; allow-update { none; }; }; # set zone for internal *note zone "1.169.192.in-addr.arpa" { type master; file "1.169.192.db"; allow-update { none; }; }; zone "localhost" { type master; file "db.local"; }; zone "127.in-addr.arpa" { type master; file "db.127"; }; zone "0.in-addr.arpa" { type master; file "db.0"; }; zone "255.in-addr.arpa" { type master; file "db.255"; }; }; root@dlp:~# vim /etc/bind/named.conf.external-zones # create new # define for external section view "external" { match-clients { any; }; # allo any query allow-query { any; }; # prohibit recursion recursion no; # set zone for external zone "dadiling.com" { type master; file "dadiling.com.wan"; allow-update { none; }; }; # set zone for external *note zone "70.159.125.59.in-addr.arpa" { type master; file "70.159.125.59.db"; allow-update { none; }; }; }; # *note : For How to write for reverse resolving, Write network address reversely like below 10.0.0.0/24 network address ⇒ 192.168.1.0 range of network ⇒ 192.168.1.0 - 192.168.1.255 how to write ⇒ 1.168.192.in-addr.arpa 59.125.159.70/29 network address ⇒ 59.125.159.70 range of network ⇒ 59.125.159.70 - 59.125.159.78 how to write ⇒ 70.159.125.59.in-addr.arpa |
本篇文章引用網址
http://123.204.89.156/etype/modules/weblog/weblog-tb.php/89