Syed Jahanzaib Personal Blog to Share Knowledge !

January 9, 2012

Using WEBMIN to create Forward/Reverse ZONE in BIND / UBUNTU

For some people , installing and configuring BIND for local network using CLI can be a typical task. However it can be done easily in few steps via using GUI base controller known as WEBMIN which is a very nice and powerful GUI to manage  almost every service of your Linux box via your browser.

In this article we will discuss following topics.

1# Install WEBMIN (Using 2 different methods)
2# Install BIND (Using WEBMIN)
3# Create Forward Zone for our domain
4# Create Reverse Zones for our domain
5# Test Zones via nslookup
6# DNS configuration files

1# Install WEBMIN Using DKPKG

First we need to install webmin. you can either download it from webmin site and install it by issuing following commands.

# then run the following command
dpkg --install webmin_1.570_all.deb

You should now be able to login to Webmin via your browser using the URL


IF the above method fails to install WEBMIN on your system, Follow this alternate method to install it.

1# Install WEBMIN Using the Webmin APT repository [Alternate Way]

install and update Webmin via APT, edit the /etc/apt/sources.list file by using the following command

nano /etc/apt/sources.list
and add these lines at end.

deb sarge contrib
deb sarge contrib

Now Save the file and exit.

You should also fetch and install my GPG key with which the repository is signed, with the commands :

cd /root
apt-key add jcameron-key.asc

You will now be able to install with the commands :

apt-get update
apt-get install webmin

For more information on other distribution installation , please visit

2# INSTALLING BIND via webmin.

After logging in to Webmin ,

It will inform you that bind is not installed, install it via click on “Click Here
As shown in the image below . . .

Now it will download BIND and install it. Make sure your Linux box is connected with the internet. After installation it will show you something
As shown in the image below . . .

Now that BIND is installed, We have to create Forward and Reverse zones for our new domain. In last we will check it by doing nslookup.

3# Adding FORWARD ZONE for our domain


Now you will see BIND DNS SERVER and various icons.
First we have to create forward zone,
As shown in the image below . . .

> in Zone Type : Select Forward
> in Domain name / Network , type the name you want to configure your domain with.
As shown in the image below . . .

4# Adding REVERSE ZONE for our domain

Now we have to create Reverse Zone,
As shown in the image below . . .

Now on your TOP RIGHT, click on APPLY CHANGES.


Login to your client pc, open command prompt and issue the following command.
nslookup –

now type and you should see your Linux box ip in response.
As shown in the image below . . .

All Done. Now you can careate hosts record / MX record etc using GUI base DNS MANAGEMENT CONSOLE 🙂


*** Can’t find server name *** ERROR

When you do NSLOOKUP, you see an error something like.
*** Can’t find server name for address Non-existent domain, Default ServeR: UnKnown

To solve this , jsut add reverse lookup entry for your domain.
Open your newly created zone in EXISTING DNS ZONES
As shown in the image below . . .

After opening or your zone,
Click on ADDRESS
Here create an address
In Name:
In Address:
Click on CREATE and then APPLY CHANGES.
Now from you client side, try to do nslookup, and this time you wont see any error.

Create MX record for MAIL Server 🙂

Creating an MX Record (Mail Exchange Record).

1) Open your zone , for example ,
Click on Mail Server
2) For the name, type in the domain e.g
3) For the mail server, type in
4) Set the priority to what you like.. 10 is usually default.
5) Click on SAVE and aplpy changes.

Make sure your Linux box have your BIND Server IP at top.

Edit your resolv.conf and set dns name server search order.

# Generated by NetworkManager

Adding Forwarding Entry (For resolving External Hosts)

Click on Forwarding and Transfers
In Servers to forward queries to, type your ISP’s DNS Server IP
As shown in the image below . . .

Now when your client will do query , BIND will first check in, if it doesn’t fin any entry, it will forward this query to ISP’S DNS Server.

6# DNS configuration files


$ttl 38400 IN SOA ubuntu. (
38400 ) IN NS ubuntu. IN A


$ttl 38400 IN SOA ubuntu. (
38400 ) IN NS ubuntu. IN PTR


acl internal {
options {
directory "/var/cache/bind";
auth-nxdomain no; # conform to RFC1035
listen-on { any; };
listen-on port 53 {; any; };
allow-query { internal; };
allow-query-cache { internal; };
forwarders {


zone "" {
type master;
file "/var/lib/bind/";
zone "" {
type master;
file "/var/lib/bind/192.168.0.rev";

Have Fun 🙂

Sample named.conf.option for caching/forward dns server. useful for ISP

root@ZAIB:/etc/bind# cat named.conf.options

acl goodclients {
# Allwo this series only to query our dns server;
options {
directory "/var/cache/bind";
recursion yes;
allow-recursion { goodclients; };
allow-query { goodclients; };

# DNS Forwarded to fetch request from GOOGLE DNS and then cache it
forwarders {;;
dnssec-validation auto;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };




  1. Zaib bhai, that’s awesome…………………..thanks for sharing such a nice how-to…

    I think, there is one writing mistake,,,,,,,might be i am wrong,but i am just pointing it so that you will correct it if you think that it’s just a writing mistake.

    IF the above method fails to install (WEBMIN ) instead of *(ubuntu) on your system.



    Comment by arbabnazar — January 9, 2012 @ 11:44 PM

  2. Zaib thax yaar coz of this steps my 10 day old DNS started to work without “non-existing domain name error.

    Thk u very much



    Comment by Sandesh — February 5, 2012 @ 4:24 PM

  3. why i can’t nslookup for reverse address?? my server ip, when i try to nslookup the address, it’s not working.. but, when i use the domain the running well


    Comment by ray — April 5, 2012 @ 7:55 PM

  4. Excellent tutorial. Thanks!


    Comment by Catalin — July 29, 2012 @ 6:01 PM

  5. Great! For the first time i have configured bind in my home network without struggling!!! You are my savior!!!^_^


    Comment by daysleeper — November 20, 2012 @ 1:58 PM

  6. Hey in the reverse configuration… my network is x.y.z.130 – x.y.z.134 (I think the snm is .248) how do I set the reverse zone to work in that range only? do i put x.y.z.130/28 in the Domain name/Network field?



    Comment by ksgamerboi — January 31, 2013 @ 6:35 AM

  7. Reblogged this on Welcome To Prasad Linux Blog and commented:
    Good doc for DNS


    Comment by prasadjadhav — February 16, 2013 @ 7:40 PM

  8. Dear sir

    I configured dns server on ubuntu desktop. and its working on
    public IPs properly but can work with nating (private )address
    and give me the following error…
    Default Server:


    *** can’t find Query refused


    Comment by kazimjhon — February 23, 2013 @ 7:08 PM

  9. i have 2 VPS with public IP and i would like to host multiple sites. both runn debian 7 with webmin. i have created the first domain and NS1/2 and one replicates to the other. now i installed webmin and i would like to add some more domains for dns zones. how do u do that?


    Comment by john — December 1, 2013 @ 1:47 AM

  10. Hello. Very Nice article! 🙂 .. I have a VPS in digitalocean, is it I use my virtualmin to administrate my sites.
    what Vesta pc automatically makes that meets any need for cloudflare? and how I do it in vitualmin for me to spend not use the limited vestacp?
    weird. with Vesta installed, the same values ​​in all tables in two places: cloudflare and digitalocean, sign spf, dkim, DMARC in my 5 domains
    no matter what I go on hostgator where I recorded my fields and points to any table .. DO or CF will always work.

    when installed virtualmin with the same tables sign all emails only when the hostgator panel point to the DO when I point to c.f. DKIM not sign. pass = Fail !!

    What about the other fact, to not come online my subserver / subdomains, I find it strange that in Webmin / virtualmin when I access server dns bind all virtualserver / fields have a master zone auto created and all records entries!
    but subserver not have master zone! nor are the lists of areas!

    I think the fact of being offline is why. as I must master to create zones for my subservers, but what should I do? assuming you want to use cloudflare, and not dns / we own. already heard of something related to exernos dns, I think that’s what to wanting to do, and at Vesta already does everything alone, but is a very weak panel very aspects, and can use more memory than the virtualmin that does much more that he!

    Hare in virtualmin all sites work on any table, or cloudflare digitalocean, but not with assintar email if it is not in hostgator point my domains for digitalocean which is the same place where I have my vps with virtualmin.

    and the other problem is that subservers, subdomains not come online in virtualmin in any way, no matter the pointing done in hostgator.


    Comment by morenek — September 14, 2015 @ 7:01 PM

    • but also I noticed that the dns records of subserver / subdomains are in the dns settings file of the parent domain. m virtualmin> server configuration> dns records> manually edit records … then why not go online? lack create entries of the children in cloudflare? because in add sites not give to add subdomains.


      Comment by morenek — September 14, 2015 @ 9:46 PM

      • what lack I make in virtualmin for him to apply the dkim signing an external dns (cloudflare with copy and paste, obviously) without the internal dns tables of digital ocean, which is where my vps runs the virtualmin and my sites?


        Comment by morenek — September 14, 2015 @ 10:22 PM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: