Install/Configure BIND2013/05/06 |
Configure DNS server which resolves domain name or IP address.
|
|
[1] | Install BIND |
root@dlp:~# aptitude -y install bind9 bind9utils dnsutils
|
[2] | Configure BIND This example is done with grobal IP address [172.16.0.80/29], Private IP address [10.0.0.0/24], Domain name [srv.world]. However, Please use your own IPs and domain name when you set config on your server. ( Actually, [172.16.0.80/29] is for private IP address, though. ) |
root@dlp:~#
include "/etc/bind/named.conf.options";vi /etc/bind/named.conf 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:~#
vi /etc/bind/named.conf.internal-zones # create new # define for internal section view "internal" { match-clients { localhost; 10.0.0.0/24; }; # set zone for internal zone "srv.world" { type master; file "/etc/bind/srv.world.lan"; allow-update { none; }; }; # set zone for internal *note zone "0.0.10.in-addr.arpa" { type master; file "/etc/bind/0.0.10.db"; allow-update { none; }; }; include "/etc/bind/named.conf.default-zones"; };
root@dlp:~#
vi /etc/bind/named.conf.external-zones # create new # define for external section view "external" { # define for external section match-clients { any; }; # allo any query allow-query { any; }; # prohibit recursion recursion no; # set zone for external zone "srv.world" { type master; file "/etc/bind/srv.world.wan"; allow-update { none; }; }; # set zone for external *note zone "80.0.16.172.in-addr.arpa" { type master; file "/etc/bind/80.0.16.172.db"; allow-update { none; }; }; }; # *note : For How to write for reverse resolving, Write network address reversely like below 10.0.0.0/24
For the case of 10.0.0.0/24
network address ⇒ 10.0.0.0 network range ⇒ 10.0.0.0 - 10.0.0.255
how to write
For the case of 172.16.0.80/29 ⇒ 0.0.10.in-addr.arpa
network address ⇒ 172.16.0.80 network range ⇒ 172.16.0.80 - 172.16.0.87 how to write ⇒ 80.0.16.172.in-addr.arpa
|
[3] | Limit ranges you allow to access if needed. |
root@dlp:~#
options {vi /etc/bind/named.conf.options directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder.
// forwarders { // 0.0.0.0; // };
# query range you permit allow-query { localhost; 10.0.0.0/24; }; # the range to transfer zone files allow-transfer { localhost; 10.0.0.0/24; }; # recursion range you allow allow-recursion { localhost; 10.0.0.0/24; };
dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 # make it comment if not use IPV6 # listen-on-v6 { any; };}; |
Sponsored Link |
|