How to set up a nameserver DNS Ubuntu – Debian

How to set up a Nameserver or DNS | Ubuntu and Debian

This tutorial will attempt to illustrate how to set up your own nameserver (,  Nameservers seem to be very easy to hack or abuse,  so it is recommended that you use your registrar or host to configure your DNS.  It is usually free and one less thing for you to worry about.

You will need 3 IP numbers, and your nameservers already registered with your registrar and assigned the IP numbers you are going to use.  For this tutorial we will use the example and will be using and as our nameservers.  This can be done with 2 IP numbers in a pinch, we would just leave out the 2nd nameserver (

Go to your Webmin control panel and sign in.  Click the “Servers”  link,  then select the “BIND DNS Server”  link . If Bind is not installed click the link that says APT will install it for you.  You should be at the main Bind DNS Server page now.


Click the “Miscellaneous Options” icon:


Go to the “Do full recursive lookups for clients?”  option and select “No” like the picture above.  Click the “Save” button

Click the  “Create master zone.” link


Enter the domain into the “Domain name / network” box.

For the master server, type in the domain name as well.

Check the “Create NS record” box.

Enter your email address in the appropriate box.

Type in the IP address of the server,  the number(The external IP address provided by your ISP).


Click the  “Create” button.

You will then be redirected to the zone page for that domain you just created. (If you weren’t, click on the zone for that domain).


Click on “Address”

Leave the name field blank, and type in the IP address.


Click the  “Create”  button.

Type in www for the name, and type in the IP address.


Click the “Create” button.

Type in mail for the name, and type in the IP address.
Click the “Create” button.

Type in ns1 for the name, and type in the IP address.
Click the “Create” button.

Type in ns2 for the name, and type in the IP address.
Click the “Create” button.


At the bottom, click the  “Return to Record Types” link.

Click on the  “Name Server” icon
For the zone name, type in the domain name (Put a . at the end; for example:  )(notice the ending period.. DO Not Forget that)

For the name server, type in
(Also notice the period)


Click the  “Create”  button.

Do the same for ns2 , don’t forget the period .


Click the “Return to Record Types”  link.

Click the “Mail Server” icon.

For the name, type in the   (don’t forget the period at the end)
For the mail server, type in  (don’t forget the period at the end)
Set the priority to what you like.. 10 is usually default.


Click the  “Create”  button.

Click the  “Return to Record Types”  link at the bottom.

Click the “Start Bind” link at the top right, or the “Apply Configuration” link if Bind was already started. You now have a fully configured nameserver.