- Install BIND packages that provides DNS service
- yum install bind bind-utils bind-chroot bind-libs
- Edit the main file /etc/named.conf
listen-on port 53 { 192.168.12.2; }; //change this to your ip address
*Remove the allow-query line
zone "msm.net" IN { //chnage msm.net to your zone
type master;
file "msm.net.db"; //you can name it anything
};
zone "12.168.192.in-addr.arpa" IN { //this is for reverse lookup the zone will be //different for different ip address
type master;
file "12.168.192.rev.zone.db";
};
*Optional: remove the "." zone to disable caching.
- Now create the "msm.net.db" file in /var/named and edit it (forward lookup)
- vi 'msm.net.db'
@ IN SOA ns.msm.net. nameserver.ns.msm.net. (
535 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS ns.msm.net. //change this to match your domain
ns IN A 192.168.12.2 //these are the dns records
slave IN A 192.168.12.3
root IN A 192.168.12.4
cache IN A 192.168.12.5
- Now create "12.168.192.rev.zone.db" and edit it
- vi '12.168.192.rev.zone.db'
@ IN SOA ns.msm.net. nameserver.ns.msm.net. (
2009092300 ; serial
2880 ; refresh
14400 ; retry
3600000 ; expiry
86400 ; minimum
);
//change the values according to your records and domain name
@ IN NS ns.msm.net.
2 IN PTR ns.msm.net.
3 IN PTR slave.msm.net.
4 IN PTR root.msm.net.
5 IN PTR cache.msm.net.
- Open the firewall ports
- iptables -I INPUT -p tcp --dport 53 -j ACCEPT
- iptables -I INPUT -p udp --dport 53 -j ACCEPT
- Start the named daemon
- service named start
- check logs if your server started properly
- tail -30 /var/log/messages
- Edit /etc/resolve.conf to tell the system to resolve DNS queries locally through our newly created primary server
- vi /etc/resolve.conf
nameserver 192.168.12.2
- check your deployment using nslookup
- nslookup
- ns.msm.net
- 192.168.12.2
Prefer a video walk-through?
Here is a video I made of my deployment.
No comments:
Post a Comment