Configure DNS as as Slave Server. It's easy to set up it.
Following example shows an environment that master DNS is "ns.server-linux.info", Slave DNS is "ns.example.info".
[1] Write config in Zone file on Master DNS.
[root@ns ~]# vi /var/named/server-linux.info.wan
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
# update serial
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
INNSns.server-linux.info.
# add name server
INNSns.example.info.
INA172.16.0.82
INMX 10ns.server-linux.info.
nsINA172.16.0.82
[root@ns ~]# rndc reload
server reload successful
Showing posts with label DNS. Show all posts
Showing posts with label DNS. Show all posts
3/02/2011
2/17/2011
Start and operation BIND
Start BIND
[1] Configuration of BIND completed, However, Create chroot environment before making named run.
[root@ns ~]# yum -y install bind-chroot
[root@ns ~]# /etc/rc.d/init.d/named start
[root@ns ~]# chkconfig named on
Operation check
[2] Make sure server can resolve domain names or IP addresses.
[root@ns ~]# dig ns.server-linux.info.
; <<>> DiG 9.3.4 <<>> ns.server-linux.info.
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54592
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ns.server-linux.info. IN A
;; ANSWER SECTION:
ns.server-linux.info. 86400 IN A 192.168.0.17
;; AUTHORITY SECTION:
server-linux.info. 86400 IN NS ns.server-linux.info.
;; Query time: 0 msec
;; SERVER: 192.168.0.17#53(192.168.0.17)
;; WHEN: Thu Mar 8 19:35:19 2007
;; MSG SIZE rcvd: 68
[1] Configuration of BIND completed, However, Create chroot environment before making named run.
[root@ns ~]# yum -y install bind-chroot
[root@ns ~]# /etc/rc.d/init.d/named start
[root@ns ~]# chkconfig named on
Operation check
[2] Make sure server can resolve domain names or IP addresses.
[root@ns ~]# dig ns.server-linux.info.
; <<>> DiG 9.3.4 <<>> ns.server-linux.info.
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54592
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ns.server-linux.info. IN A
;; ANSWER SECTION:
ns.server-linux.info. 86400 IN A 192.168.0.17
;; AUTHORITY SECTION:
server-linux.info. 86400 IN NS ns.server-linux.info.
;; Query time: 0 msec
;; SERVER: 192.168.0.17#53(192.168.0.17)
;; WHEN: Thu Mar 8 19:35:19 2007
;; MSG SIZE rcvd: 68
2/16/2011
Create zone files that servers resolve IP address from domain name on linux.
Create zone files that servers resolve IP address from domain name on linux.
[1] For internal zone
This example uses internal address[192.168.0.0/24], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/server-linux.info.lan
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# internal IP address of name server
INA192.168.0.17
# define Mail exchanger
INMX 10ns.server-linux.info.
# define IP address and hostname
nsINA192.168.0.17
[2] For external zone
This example uses external address[172.16.0.80/29], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/server-linux.info.wan
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# external IP address of name server
INA172.16.0.82
# define Mail exchanger
INMX 10ns.server-linux.info.
# define IP address and hostname
nsINA172.16.0.82
Reverse resolution
Create zone files that servers resolve domain names from IP address.
[3] For internal zone
This example uses internal address[192.168.0.0/24], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/0.168.192.db
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# define range that this domain name in
INPTRserver-linux.info.
# define IP address and hostname
INA255.255.255.0
17INPTRns.server-linux.info.
[4] For external zone
This example uses external address[172.16.0.80/29], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/80.0.16.172.db
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# define range that this domain name in
INPTRserver-linux.info.
# define IP address and hostname
INA255.255.255.248
82INPTRns.server-linux.info.
[1] For internal zone
This example uses internal address[192.168.0.0/24], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/server-linux.info.lan
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# internal IP address of name server
INA192.168.0.17
# define Mail exchanger
INMX 10ns.server-linux.info.
# define IP address and hostname
nsINA192.168.0.17
[2] For external zone
This example uses external address[172.16.0.80/29], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/server-linux.info.wan
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# external IP address of name server
INA172.16.0.82
# define Mail exchanger
INMX 10ns.server-linux.info.
# define IP address and hostname
nsINA172.16.0.82
Reverse resolution
Create zone files that servers resolve domain names from IP address.
[3] For internal zone
This example uses internal address[192.168.0.0/24], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/0.168.192.db
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# define range that this domain name in
INPTRserver-linux.info.
# define IP address and hostname
INA255.255.255.0
17INPTRns.server-linux.info.
[4] For external zone
This example uses external address[172.16.0.80/29], domain name[server-linux.info], but please use your own one when you set config on your server.
[root@ns ~]# vi /var/named/80.0.16.172.db
$TTL86400
@INSOAns.server-linux.info. root.server-linux.info. (
2007041501;Serial
3600;Refresh
1800;Retry
604800;Expire
86400;Minimum TTL
)
# define name server
INNSns.server-linux.info.
# define range that this domain name in
INPTRserver-linux.info.
# define IP address and hostname
INA255.255.255.248
82INPTRns.server-linux.info.
2/14/2011
Install and configure BIND on Linux
Build DNS server which resolves domain name or IP address. Install bind and caching-nameserver for it. And it's also neccessary to configure router so that TCP and UDP packets to 53 can pass through.
1. Install BIND
[root@ns ~]#
yum -y install bind caching-nameserver
2. Configure BIND
This example is done with grobal IP address [172.16.0.80/29], Private IP address [192.168.0.0/24], Domain name [server-linux.info]. 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@ns ~]#
vi /etc/named.conf
options {
directory "/var/named";
# query range
allow-query { localhost; 192.168.0.0/24; };
# transfer range
allow-transfer { localhost; 192.168.0.0/24; };
# recursion range
allow-recursion { localhost; 192.168.0.0/24; };
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
# here is the section for internal informations
view "internal" {
match-clients {
localhost;
192.168.0.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
# set zones for internal
zone "server-linux.info" IN {
type master;
file "server-linux.info.lan";
allow-update { none; };
};
# set zones for internal
zone "0.168.192.in-addr.arpa" IN {
type master;
file "0.168.192.db";
allow-update { none; };
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
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; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
};
view "external" {
match-clients {
any;
};
zone "." IN {
type hint;
file "named.ca";
};
# set zones for external
zone "server-linux.info" IN {
type master;
file "server-linux.info.wan";
allow-update { none; };
};
# set zones for external *note
zone "80.0.16.172.in-addr.arpa" IN {
type master;
file "80.0.16.172.db";
allow-update { none; };
};
};
include "/etc/rndc.key";
# *note : For How to write for reverse resolving, Write network address reversely like below.
the case for 192.168.0.0/24
network address
⇒ 192.168.0.0
range of network
⇒ 192.168.0.0 - 192.168.0.255
how to write
⇒ 0.168.192.in-addr.arpa
case of 172.16.0.80/29
network address
⇒ 172.16.0.80
range of network
⇒ 172.16.0.80 - 172.16.0.87
how to write
⇒ 80.0.16.172.in-addr.arpa
From (server-world.info)
1. Install BIND
[root@ns ~]#
yum -y install bind caching-nameserver
2. Configure BIND
This example is done with grobal IP address [172.16.0.80/29], Private IP address [192.168.0.0/24], Domain name [server-linux.info]. 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@ns ~]#
vi /etc/named.conf
options {
directory "/var/named";
# query range
allow-query { localhost; 192.168.0.0/24; };
# transfer range
allow-transfer { localhost; 192.168.0.0/24; };
# recursion range
allow-recursion { localhost; 192.168.0.0/24; };
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
# here is the section for internal informations
view "internal" {
match-clients {
localhost;
192.168.0.0/24;
};
zone "." IN {
type hint;
file "named.ca";
};
# set zones for internal
zone "server-linux.info" IN {
type master;
file "server-linux.info.lan";
allow-update { none; };
};
# set zones for internal
zone "0.168.192.in-addr.arpa" IN {
type master;
file "0.168.192.db";
allow-update { none; };
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
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; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
};
view "external" {
match-clients {
any;
};
zone "." IN {
type hint;
file "named.ca";
};
# set zones for external
zone "server-linux.info" IN {
type master;
file "server-linux.info.wan";
allow-update { none; };
};
# set zones for external *note
zone "80.0.16.172.in-addr.arpa" IN {
type master;
file "80.0.16.172.db";
allow-update { none; };
};
};
include "/etc/rndc.key";
# *note : For How to write for reverse resolving, Write network address reversely like below.
the case for 192.168.0.0/24
network address
⇒ 192.168.0.0
range of network
⇒ 192.168.0.0 - 192.168.0.255
how to write
⇒ 0.168.192.in-addr.arpa
case of 172.16.0.80/29
network address
⇒ 172.16.0.80
range of network
⇒ 172.16.0.80 - 172.16.0.87
how to write
⇒ 80.0.16.172.in-addr.arpa
From (server-world.info)
Subscribe to:
Posts (Atom)
