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 ( ns1.yourdomain.com, ns2.yourdomain.com).  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  domain.com and will be using ns1.domain.com and ns2.domain.com as our nameservers.  This can be done with 2 IP numbers in a pinch, we would just leave out the 2nd nameserver (ns2.domain.com).

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.

webmin-bind

Click the “Miscellaneous Options” icon:

webmin-bindrecursion

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

webmin-bindmaster

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 domain.com number(The external IP address provided by your ISP).

webmin-bind-createzone

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).

webmin-bind-masterzone

Click on “Address”

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

webmin-bind-createaddress

Click the  “Create”  button.

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

webmin-bindwww

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.

webminaddresses

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:
domain.com.  )(notice the ending period.. DO Not Forget that)

For the name server, type in ns1.domain.com.
(Also notice the period)

webmin-nameserver

Click the  “Create”  button.

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

webmin-binddomains

Click the “Return to Record Types”  link.

Click the “Mail Server” icon.

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

webmin-bind-mailserver

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.