Skip to main content

Configuring and Deploying DNS servers (primary, secondary, root and cache on centos 6.5) - Part 1 - Primary DNS

Make sure you have connection to the internet before you attempt this.

  • 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 {; }; //change this to your ip address
*Remove the allow-query line
zone "" IN { //chnage to your zone
        type master;
        file ""; //you can name it anything

zone "" IN { //this is for reverse lookup the zone will be                                                       //different for different ip address
        type master;
        file "";

*Optional: remove the "." zone to disable caching.

  • Now create the "" file in /var/named and edit it (forward lookup)
    • vi ''
$TTL 86400
@       IN   SOA (
                        535 ; serial
                        3H ; refresh
                        15M ; retry
                        1W ; expiry
                        1D ) ; minimum
@                       IN      NS //change this to match your domain
ns                      IN      A //these are the dns records
slave                   IN      A
root                    IN      A
cache                   IN      A

  •  Now create "" and edit it
    • vi ''
 $TTL 86400
@       IN   SOA (
                        2009092300 ; serial
                        2880 ; refresh
                        14400 ; retry
                        3600000 ; expiry
                        86400  ; minimum


//change the values according to your records and domain name
@               IN      NS
2               IN      PTR
3               IN      PTR
4               IN      PTR
5               IN      PTR

  • 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
 *NOTE: if you get this error "Generating /etc/rndc.key:" then try to open another ssh window and give some user input, try issuing some command while it is saying this error, or open the VM GUI and open the web browser. Comment if you could not resolve this error.

  • 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

  • check your deployment using nslookup
    • nslookup
Let me know in the comments if there are any issues. 

Prefer a video walk-through?
Here is a video I made of my deployment.


Popular posts from this blog

ASUS RT N16 + OpenWRT + nodogsplash = WiFi Hotspot (For beginners)

1.Make sure you are directly connected to the router through a cable ·Take an ethernet cable from your ASUS modem and plug it into your pc/laptop
2.Now access your modem by going into the browser and typing: ·Go to administration tab and click on Firmware upgrade/update NOTE: Please use internet explorer for all of these configurations. There are some issues reported in other browsers. 3.You will have to load a DD-WRT basic image first to load the openWRT image. You cannot directly load openWRT image for some reason I dont know of ·Download the image by clicking on the link:
4.Once the image is downloaded just click on browse on the ASUS firmware upgrade page and browse to the DDWRT image and upload it

How to Install GTK-RecordMyDesktop on RHEL 7 (best screen recording software imo)

If you want to record your screen to make tutorials or something else, GTK-recordmydesktop is capable of doing it. Most of the screen-recording programs that I have come across requires you to record your audio separately, however this software is also capable of recording audio without any extra step. It can also work with JACK audio server.

PART 1 - Install EPL repository for RHEL 7:
Open a terminalInstall epel using the following command: yum -y install epel-release.Refresh repo by typing the following commad: yum repolist.PART 2 - Install GTK-RecordMyDesktop: yum install gtk-recordmydesktop That's it, it should work right away. If it doesn't, it is possible that you might be missing some codecs as I installed them from nux and epel repos earlier.

Create isolated network on Virtual Machine Manager - Centos 6.5

Since most of the Linux administration practice is done in a virtual environment, I thought I should create a video about it, as I am aware that some students at my college struggle with it in their labs. Please let me know if I missed anything or did not explain anything clearly.